mirror of
https://github.com/EggLinks/DanhengServer-OpenSource.git
synced 2026-01-03 04:36:03 +08:00
Feature:Asynchronous Operation & Formatting Code
- Now the async operation is enabled! - Code formatted by Resharper plugin <3
This commit is contained in:
@@ -1,14 +1,5 @@
|
||||
using EggLink.DanhengServer.Data.Excel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
public class AnchorInfo : PositionInfo
|
||||
{
|
||||
public class AnchorInfo : PositionInfo
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,52 +1,32 @@
|
||||
using EggLink.DanhengServer.Util;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
public class DialogueInfo
|
||||
{
|
||||
public class DialogueInfo
|
||||
public List<DialogueTaskInfo> OnInitSequece { get; set; } = [];
|
||||
public List<DialogueTaskInfo> OnStartSequece { get; set; } = [];
|
||||
|
||||
[JsonIgnore] public List<int> DialogueIds { get; set; } = [];
|
||||
|
||||
public void Loaded()
|
||||
{
|
||||
public List<DialogueTaskInfo> OnInitSequece { get; set; } = [];
|
||||
public List<DialogueTaskInfo> OnStartSequece { get; set; } = [];
|
||||
foreach (var task in OnInitSequece)
|
||||
foreach (var ta in task.TaskList)
|
||||
foreach (var option in ta.OptionList)
|
||||
DialogueIds.Add(option.DialogueEventID);
|
||||
|
||||
[JsonIgnore]
|
||||
public List<int> DialogueIds { get; set; } = [];
|
||||
|
||||
public void Loaded()
|
||||
{
|
||||
foreach (var task in OnInitSequece)
|
||||
{
|
||||
foreach (var ta in task.TaskList)
|
||||
{
|
||||
foreach (var option in ta.OptionList)
|
||||
{
|
||||
DialogueIds.Add(option.DialogueEventID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var task in OnStartSequece)
|
||||
{
|
||||
foreach (var ta in task.TaskList)
|
||||
{
|
||||
foreach (var option in ta.OptionList)
|
||||
{
|
||||
DialogueIds.Add(option.DialogueEventID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DialogueTaskInfo
|
||||
{
|
||||
public List<DialogueTaskInfo> TaskList { get; set; } = [];
|
||||
public List<DialogueTaskInfo> OptionList { get; set; } = [];
|
||||
|
||||
public int DialogueEventID { get; set; }
|
||||
foreach (var task in OnStartSequece)
|
||||
foreach (var ta in task.TaskList)
|
||||
foreach (var option in ta.OptionList)
|
||||
DialogueIds.Add(option.DialogueEventID);
|
||||
}
|
||||
}
|
||||
|
||||
public class DialogueTaskInfo
|
||||
{
|
||||
public List<DialogueTaskInfo> TaskList { get; set; } = [];
|
||||
public List<DialogueTaskInfo> OptionList { get; set; } = [];
|
||||
|
||||
public int DialogueEventID { get; set; }
|
||||
}
|
||||
@@ -1,15 +1,9 @@
|
||||
using EggLink.DanhengServer.Data.Config.Task;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
public class FetchAdvPropData
|
||||
{
|
||||
public class FetchAdvPropData
|
||||
{
|
||||
public DynamicFloat GroupID { get; set; } = new();
|
||||
public DynamicFloat ID { get; set; } = new();
|
||||
}
|
||||
}
|
||||
public DynamicFloat GroupID { get; set; } = new();
|
||||
public DynamicFloat ID { get; set; } = new();
|
||||
}
|
||||
@@ -1,130 +1,112 @@
|
||||
using EggLink.DanhengServer.Enums.Scene;
|
||||
using EggLink.DanhengServer.Util;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
public class FloorInfo
|
||||
{
|
||||
public class FloorInfo
|
||||
[JsonIgnore] public Dictionary<int, PropInfo> CachedTeleports = [];
|
||||
|
||||
[JsonIgnore] public Dictionary<int, GroupInfo> Groups = [];
|
||||
|
||||
[JsonIgnore] public bool Loaded;
|
||||
|
||||
[JsonIgnore] public List<PropInfo> UnlockedCheckpoints = [];
|
||||
|
||||
public int FloorID { get; set; }
|
||||
public int StartGroupIndex { get; set; }
|
||||
public int StartAnchorID { get; set; }
|
||||
|
||||
public List<FloorGroupInfo> GroupInstanceList { get; set; } = [];
|
||||
public List<FloorSavedValueInfo> SavedValues { get; set; } = [];
|
||||
public List<FloorCustomValueInfo> CustomValues { get; set; } = [];
|
||||
public List<FloorDimensionInfo> DimensionList { get; set; } = [];
|
||||
|
||||
[JsonIgnore] public int StartGroupID { get; set; }
|
||||
|
||||
public AnchorInfo? GetAnchorInfo(int groupId, int anchorId)
|
||||
{
|
||||
public int FloorID { get; set; }
|
||||
public int StartGroupIndex { get; set; }
|
||||
public int StartAnchorID { get; set; }
|
||||
Groups.TryGetValue(groupId, out var group);
|
||||
if (group == null) return null;
|
||||
|
||||
public List<FloorGroupInfo> GroupInstanceList { get; set; } = [];
|
||||
public List<FloorSavedValueInfo> SavedValues { get; set; } = [];
|
||||
public List<FloorCustomValueInfo> CustomValues { get; set; } = [];
|
||||
public List<FloorDimensionInfo> DimensionList { get; set; } = [];
|
||||
return group.AnchorList.Find(info => info.ID == anchorId);
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool Loaded = false;
|
||||
[JsonIgnore]
|
||||
public Dictionary<int, GroupInfo> Groups = [];
|
||||
public void OnLoad()
|
||||
{
|
||||
if (Loaded) return;
|
||||
|
||||
[JsonIgnore]
|
||||
public Dictionary<int, PropInfo> CachedTeleports = [];
|
||||
[JsonIgnore]
|
||||
public List<PropInfo> UnlockedCheckpoints = [];
|
||||
StartGroupID = GroupInstanceList[StartGroupIndex].ID;
|
||||
|
||||
[JsonIgnore]
|
||||
public int StartGroupID { get; set; }
|
||||
foreach (var dimension in DimensionList) dimension.OnLoad(this);
|
||||
|
||||
public AnchorInfo? GetAnchorInfo(int groupId, int anchorId)
|
||||
{
|
||||
Groups.TryGetValue(groupId, out GroupInfo? group);
|
||||
if (group == null) return null;
|
||||
|
||||
return group.AnchorList.Find(info => info.ID == anchorId);
|
||||
}
|
||||
|
||||
public void OnLoad()
|
||||
{
|
||||
if (Loaded) return;
|
||||
|
||||
StartGroupID = GroupInstanceList[StartGroupIndex].ID;
|
||||
|
||||
foreach (var dimension in DimensionList)
|
||||
// Cache anchors
|
||||
foreach (var group in Groups.Values)
|
||||
foreach (var prop in group.PropList)
|
||||
// Check if prop can be teleported to
|
||||
if (prop.AnchorID > 0)
|
||||
{
|
||||
dimension.OnLoad(this);
|
||||
// Put inside cached teleport list to send to client when they request map info
|
||||
CachedTeleports.TryAdd(prop.MappingInfoID, prop);
|
||||
UnlockedCheckpoints.Add(prop);
|
||||
|
||||
// Force prop to be in the unlocked state
|
||||
prop.State = PropStateEnum.CheckPointEnable;
|
||||
}
|
||||
|
||||
// Cache anchors
|
||||
foreach (var group in Groups.Values)
|
||||
else if (!string.IsNullOrEmpty(prop.InitLevelGraph))
|
||||
{
|
||||
foreach (var prop in group.PropList)
|
||||
var json = prop.InitLevelGraph;
|
||||
|
||||
// Hacky way to setup prop triggers
|
||||
if (json.Contains("Maze_GroupProp_OpenTreasure_WhenMonsterDie"))
|
||||
{
|
||||
// Check if prop can be teleported to
|
||||
if (prop.AnchorID > 0)
|
||||
{
|
||||
// Put inside cached teleport list to send to client when they request map info
|
||||
CachedTeleports.TryAdd(prop.MappingInfoID, prop);
|
||||
UnlockedCheckpoints.Add(prop);
|
||||
|
||||
// Force prop to be in the unlocked state
|
||||
prop.State = PropStateEnum.CheckPointEnable;
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(prop.InitLevelGraph))
|
||||
{
|
||||
string json = prop.InitLevelGraph;
|
||||
|
||||
// Hacky way to setup prop triggers
|
||||
if (json.Contains("Maze_GroupProp_OpenTreasure_WhenMonsterDie"))
|
||||
{
|
||||
//prop.Trigger = new TriggerOpenTreasureWhenMonsterDie(group.Id);
|
||||
}
|
||||
else if (json.Contains("Common_Console"))
|
||||
{
|
||||
//prop.CommonConsole = true;
|
||||
}
|
||||
|
||||
// Clear for garbage collection
|
||||
prop.ValueSource = null;
|
||||
prop.InitLevelGraph = null;
|
||||
}
|
||||
//prop.Trigger = new TriggerOpenTreasureWhenMonsterDie(group.Id);
|
||||
}
|
||||
else if (json.Contains("Common_Console"))
|
||||
{
|
||||
//prop.CommonConsole = true;
|
||||
}
|
||||
|
||||
// Clear for garbage collection
|
||||
prop.ValueSource = null;
|
||||
prop.InitLevelGraph = null;
|
||||
}
|
||||
|
||||
Loaded = true;
|
||||
}
|
||||
|
||||
}
|
||||
public class FloorGroupInfo
|
||||
{
|
||||
public string GroupPath { get; set; } = "";
|
||||
public bool IsDelete { get; set; }
|
||||
public int ID { get; set; }
|
||||
public string Name { get; set; } = "";
|
||||
}
|
||||
|
||||
|
||||
public class FloorSavedValueInfo
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public int DefaultValue { get; set; }
|
||||
}
|
||||
|
||||
public class FloorCustomValueInfo
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string DefaultValue { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class FloorDimensionInfo
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public List<int> GroupIndexList { get; set; } = [];
|
||||
|
||||
[JsonIgnore]
|
||||
public List<int> GroupIDList { get; set; } = [];
|
||||
|
||||
public void OnLoad(FloorInfo floor)
|
||||
{
|
||||
foreach (var index in GroupIndexList)
|
||||
{
|
||||
GroupIDList.Add(floor.GroupInstanceList[index].ID);
|
||||
}
|
||||
}
|
||||
Loaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
public class FloorGroupInfo
|
||||
{
|
||||
public string GroupPath { get; set; } = "";
|
||||
public bool IsDelete { get; set; }
|
||||
public int ID { get; set; }
|
||||
public string Name { get; set; } = "";
|
||||
}
|
||||
|
||||
public class FloorSavedValueInfo
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public int DefaultValue { get; set; }
|
||||
}
|
||||
|
||||
public class FloorCustomValueInfo
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string DefaultValue { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class FloorDimensionInfo
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public List<int> GroupIndexList { get; set; } = [];
|
||||
|
||||
[JsonIgnore] public List<int> GroupIDList { get; set; } = [];
|
||||
|
||||
public void OnLoad(FloorInfo floor)
|
||||
{
|
||||
foreach (var index in GroupIndexList) GroupIDList.Add(floor.GroupInstanceList[index].ID);
|
||||
}
|
||||
}
|
||||
@@ -4,121 +4,121 @@ using EggLink.DanhengServer.Enums.Scene;
|
||||
using EggLink.DanhengServer.Util;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using static System.Formats.Asn1.AsnWriter;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
public class GroupInfo
|
||||
{
|
||||
public class GroupInfo
|
||||
public int Id;
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public GroupLoadSideEnum LoadSide { get; set; }
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public GroupCategoryEnum Category { get; set; }
|
||||
|
||||
public string LevelGraph { get; set; } = "";
|
||||
public bool LoadOnInitial { get; set; }
|
||||
public string GroupName { get; set; } = "";
|
||||
public LoadCondition LoadCondition { get; set; } = new();
|
||||
public LoadCondition UnloadCondition { get; set; } = new();
|
||||
public LoadCondition ForceUnloadCondition { get; set; } = new();
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public SaveTypeEnum SaveType { get; set; } = SaveTypeEnum.Save;
|
||||
|
||||
public int OwnerMainMissionID { get; set; }
|
||||
public List<AnchorInfo> AnchorList { get; set; } = [];
|
||||
public List<MonsterInfo> MonsterList { get; set; } = [];
|
||||
public List<PropInfo> PropList { get; set; } = [];
|
||||
public List<NpcInfo> NPCList { get; set; } = [];
|
||||
|
||||
[JsonIgnore] public LevelGraphConfigInfo? LevelGraphConfig { get; set; }
|
||||
|
||||
[JsonIgnore] public Dictionary<string, List<int>> PropTriggerCustomString { get; set; } = [];
|
||||
|
||||
public void Load()
|
||||
{
|
||||
public int Id;
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public GroupLoadSideEnum LoadSide { get; set; }
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public GroupCategoryEnum Category { get; set; }
|
||||
public string LevelGraph { get; set; } = "";
|
||||
public bool LoadOnInitial { get; set; }
|
||||
public string GroupName { get; set; } = "";
|
||||
public LoadCondition LoadCondition { get; set; } = new();
|
||||
public LoadCondition UnloadCondition { get; set; } = new();
|
||||
public LoadCondition ForceUnloadCondition { get; set; } = new();
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public SaveTypeEnum SaveType { get; set; } = SaveTypeEnum.Save;
|
||||
public int OwnerMainMissionID { get; set; }
|
||||
public List<AnchorInfo> AnchorList { get; set; } = [];
|
||||
public List<MonsterInfo> MonsterList { get; set; } = [];
|
||||
public List<PropInfo> PropList { get; set; } = [];
|
||||
public List<NpcInfo> NPCList { get; set; } = [];
|
||||
|
||||
[JsonIgnore]
|
||||
public LevelGraphConfigInfo? LevelGraphConfig { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Dictionary<string, List<int>> PropTriggerCustomString { get; set; } = [];
|
||||
|
||||
public void Load()
|
||||
{
|
||||
foreach (var prop in PropList)
|
||||
{
|
||||
prop.Load(this);
|
||||
}
|
||||
}
|
||||
foreach (var prop in PropList) prop.Load(this);
|
||||
}
|
||||
}
|
||||
|
||||
public class LoadCondition
|
||||
public class LoadCondition
|
||||
{
|
||||
public List<Condition> Conditions { get; set; } = [];
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public OperationEnum Operation { get; set; } = OperationEnum.And;
|
||||
|
||||
public bool IsTrue(MissionData mission, bool defaultResult = true)
|
||||
{
|
||||
public List<Condition> Conditions { get; set; } = [];
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public OperationEnum Operation { get; set; } = OperationEnum.And;
|
||||
|
||||
public bool IsTrue(MissionData mission, bool defaultResult = true)
|
||||
{
|
||||
if (Conditions.Count == 0)
|
||||
if (Conditions.Count == 0) return defaultResult;
|
||||
var canLoad = Operation == OperationEnum.And;
|
||||
// check load condition
|
||||
foreach (var condition in Conditions)
|
||||
if (condition.Type == ConditionTypeEnum.MainMission)
|
||||
{
|
||||
return defaultResult;
|
||||
}
|
||||
bool canLoad = Operation == OperationEnum.And;
|
||||
// check load condition
|
||||
foreach (var condition in Conditions)
|
||||
{
|
||||
if (condition.Type == ConditionTypeEnum.MainMission)
|
||||
var info = mission.GetMainMissionStatus(condition.ID);
|
||||
if (!ConfigManager.Config.ServerOption.EnableMission) info = MissionPhaseEnum.Finish;
|
||||
|
||||
condition.Phase = condition.Phase == MissionPhaseEnum.Cancel
|
||||
? MissionPhaseEnum.Finish
|
||||
: condition.Phase;
|
||||
|
||||
if (info != condition.Phase)
|
||||
{
|
||||
var info = mission.GetMainMissionStatus(condition.ID);
|
||||
if (!ConfigManager.Config.ServerOption.EnableMission) info = MissionPhaseEnum.Finish;
|
||||
|
||||
condition.Phase = condition.Phase == MissionPhaseEnum.Cancel ? MissionPhaseEnum.Finish : condition.Phase;
|
||||
|
||||
if (info != condition.Phase)
|
||||
if (Operation == OperationEnum.And)
|
||||
{
|
||||
if (Operation == OperationEnum.And)
|
||||
{
|
||||
canLoad = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Operation == OperationEnum.Or)
|
||||
{
|
||||
canLoad = true;
|
||||
break;
|
||||
}
|
||||
canLoad = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// sub mission
|
||||
var status = mission.GetSubMissionStatus(condition.ID);
|
||||
if (!ConfigManager.Config.ServerOption.EnableMission) status = MissionPhaseEnum.Finish;
|
||||
condition.Phase = condition.Phase == MissionPhaseEnum.Cancel ? MissionPhaseEnum.Finish : condition.Phase;
|
||||
if (status != condition.Phase)
|
||||
if (Operation == OperationEnum.Or)
|
||||
{
|
||||
if (Operation == OperationEnum.And)
|
||||
{
|
||||
canLoad = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Operation == OperationEnum.Or)
|
||||
{
|
||||
canLoad = true;
|
||||
break;
|
||||
}
|
||||
canLoad = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// sub mission
|
||||
var status = mission.GetSubMissionStatus(condition.ID);
|
||||
if (!ConfigManager.Config.ServerOption.EnableMission) status = MissionPhaseEnum.Finish;
|
||||
condition.Phase = condition.Phase == MissionPhaseEnum.Cancel
|
||||
? MissionPhaseEnum.Finish
|
||||
: condition.Phase;
|
||||
if (status != condition.Phase)
|
||||
{
|
||||
if (Operation == OperationEnum.And)
|
||||
{
|
||||
canLoad = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Operation == OperationEnum.Or)
|
||||
{
|
||||
canLoad = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return canLoad;
|
||||
}
|
||||
}
|
||||
|
||||
public class Condition
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public ConditionTypeEnum Type { get; set; } = ConditionTypeEnum.MainMission;
|
||||
public int ID { get; set; }
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public MissionPhaseEnum Phase { get; set; } = MissionPhaseEnum.Accept;
|
||||
return canLoad;
|
||||
}
|
||||
}
|
||||
|
||||
public class Condition
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public ConditionTypeEnum Type { get; set; } = ConditionTypeEnum.MainMission;
|
||||
|
||||
public int ID { get; set; }
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public MissionPhaseEnum Phase { get; set; } = MissionPhaseEnum.Accept;
|
||||
}
|
||||
@@ -1,29 +1,21 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
public class LevelGraphConfigInfo
|
||||
{
|
||||
public class LevelGraphConfigInfo
|
||||
{
|
||||
public List<LevelInitSequeceConfigInfo> OnInitSequece { get; set; } = [];
|
||||
public List<LevelStartSequeceConfigInfo> OnStartSequece { get; set; } = [];
|
||||
public List<LevelInitSequeceConfigInfo> OnInitSequece { get; set; } = [];
|
||||
public List<LevelStartSequeceConfigInfo> OnStartSequece { get; set; } = [];
|
||||
|
||||
public static LevelGraphConfigInfo LoadFromJsonObject(JObject obj)
|
||||
{
|
||||
LevelGraphConfigInfo info = new();
|
||||
if (obj.ContainsKey(nameof(OnInitSequece)))
|
||||
{
|
||||
info.OnInitSequece = obj[nameof(OnInitSequece)]?.Select(x => LevelInitSequeceConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
|
||||
}
|
||||
if (obj.ContainsKey(nameof(OnStartSequece)))
|
||||
{
|
||||
info.OnStartSequece = obj[nameof(OnStartSequece)]?.Select(x => LevelStartSequeceConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
|
||||
}
|
||||
return info;
|
||||
}
|
||||
public static LevelGraphConfigInfo LoadFromJsonObject(JObject obj)
|
||||
{
|
||||
LevelGraphConfigInfo info = new();
|
||||
if (obj.ContainsKey(nameof(OnInitSequece)))
|
||||
info.OnInitSequece = obj[nameof(OnInitSequece)]
|
||||
?.Select(x => LevelInitSequeceConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
|
||||
if (obj.ContainsKey(nameof(OnStartSequece)))
|
||||
info.OnStartSequece = obj[nameof(OnStartSequece)]
|
||||
?.Select(x => LevelStartSequeceConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,18 @@
|
||||
using EggLink.DanhengServer.Data.Config.Task;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
public class LevelInitSequeceConfigInfo
|
||||
{
|
||||
public class LevelInitSequeceConfigInfo
|
||||
{
|
||||
public List<TaskConfigInfo> TaskList { get; set; } = [];
|
||||
public List<TaskConfigInfo> TaskList { get; set; } = [];
|
||||
|
||||
public static LevelInitSequeceConfigInfo LoadFromJsonObject(JObject obj)
|
||||
{
|
||||
LevelInitSequeceConfigInfo info = new();
|
||||
if (obj.ContainsKey(nameof(TaskList)))
|
||||
{
|
||||
info.TaskList = obj[nameof(TaskList)]?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
|
||||
}
|
||||
return info;
|
||||
}
|
||||
public static LevelInitSequeceConfigInfo LoadFromJsonObject(JObject obj)
|
||||
{
|
||||
LevelInitSequeceConfigInfo info = new();
|
||||
if (obj.ContainsKey(nameof(TaskList)))
|
||||
info.TaskList = obj[nameof(TaskList)]?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!))
|
||||
.ToList() ?? [];
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,24 @@
|
||||
using EggLink.DanhengServer.Data.Config.Task;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
public class LevelStartSequeceConfigInfo
|
||||
{
|
||||
public class LevelStartSequeceConfigInfo
|
||||
public List<TaskConfigInfo> TaskList { get; set; } = [];
|
||||
public bool IsLoop { get; set; }
|
||||
public int Order { get; set; }
|
||||
|
||||
public static LevelStartSequeceConfigInfo LoadFromJsonObject(JObject obj)
|
||||
{
|
||||
public List<TaskConfigInfo> TaskList { get; set; } = [];
|
||||
public bool IsLoop { get; set; } = false;
|
||||
public int Order { get; set; }
|
||||
LevelStartSequeceConfigInfo info = new();
|
||||
if (obj.ContainsKey(nameof(TaskList)))
|
||||
info.TaskList = obj[nameof(TaskList)]?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!))
|
||||
.ToList() ?? [];
|
||||
|
||||
public static LevelStartSequeceConfigInfo LoadFromJsonObject(JObject obj)
|
||||
{
|
||||
LevelStartSequeceConfigInfo info = new();
|
||||
if (obj.ContainsKey(nameof(TaskList)))
|
||||
{
|
||||
info.TaskList = obj[nameof(TaskList)]?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
|
||||
}
|
||||
if (obj.ContainsKey(nameof(IsLoop))) info.IsLoop = obj[nameof(IsLoop)]?.Value<bool>() ?? false;
|
||||
|
||||
if (obj.ContainsKey(nameof(IsLoop)))
|
||||
{
|
||||
info.IsLoop = obj[nameof(IsLoop)]?.Value<bool>() ?? false;
|
||||
}
|
||||
|
||||
if (obj.ContainsKey(nameof(Order)))
|
||||
{
|
||||
info.Order = obj[nameof(Order)]?.Value<int>() ?? 0;
|
||||
}
|
||||
return info;
|
||||
}
|
||||
if (obj.ContainsKey(nameof(Order))) info.Order = obj[nameof(Order)]?.Value<int>() ?? 0;
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +1,58 @@
|
||||
using EggLink.DanhengServer.Data.Config.Task;
|
||||
using EggLink.DanhengServer.Data.Excel;
|
||||
using EggLink.DanhengServer.Data.Excel;
|
||||
using EggLink.DanhengServer.Enums;
|
||||
using EggLink.DanhengServer.Enums.Scene;
|
||||
using EggLink.DanhengServer.Util;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
public class MissionInfo
|
||||
{
|
||||
public class MissionInfo
|
||||
{
|
||||
public int MainMissionID { get; set; }
|
||||
public List<int> StartSubMissionList { get; set; } = [];
|
||||
public List<int> FinishSubMissionList { get; set; } = [];
|
||||
public List<SubMissionInfo> SubMissionList { get; set; } = [];
|
||||
public List<CustomValueInfo> MissionCustomValueList { get; set; } = [];
|
||||
}
|
||||
|
||||
public class SubMissionInfo
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int LevelPlaneID { get; set; }
|
||||
public int LevelFloorID { get; set; }
|
||||
public int MainMissionID { get; set; }
|
||||
public string MissionJsonPath { get; set; } = "";
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public SubMissionTakeTypeEnum TakeType { get; set; }
|
||||
public List<int>? TakeParamIntList { get; set; } = []; // the mission's prerequisites
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public MissionFinishTypeEnum FinishType { get; set; }
|
||||
public int ParamInt1 { get; set; }
|
||||
public int ParamInt2 { get; set; }
|
||||
public int ParamInt3 { get; set; }
|
||||
public string ParamStr1 { get; set; } = "";
|
||||
public List<int>? ParamIntList { get; set; } = [];
|
||||
public List<MaterialItem>? ParamItemList { get; set; } = [];
|
||||
public List<FinishActionInfo>? FinishActionList { get; set; } = [];
|
||||
public int Progress { get; set; }
|
||||
public List<int>? GroupIDList { get; set; } = [];
|
||||
public int SubRewardID { get; set; }
|
||||
}
|
||||
|
||||
public class CustomValueInfo
|
||||
{
|
||||
public int Index { get; set; }
|
||||
public List<int> ValidValueParamList { get; set; } = [];
|
||||
}
|
||||
|
||||
public class FinishActionInfo
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public FinishActionTypeEnum FinishActionType { get; set; }
|
||||
public List<int> FinishActionPara { get; set; } = [];
|
||||
public List<string> FinishActionParaString { get; set; } = [];
|
||||
}
|
||||
public int MainMissionID { get; set; }
|
||||
public List<int> StartSubMissionList { get; set; } = [];
|
||||
public List<int> FinishSubMissionList { get; set; } = [];
|
||||
public List<SubMissionInfo> SubMissionList { get; set; } = [];
|
||||
public List<CustomValueInfo> MissionCustomValueList { get; set; } = [];
|
||||
}
|
||||
|
||||
public class SubMissionInfo
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int LevelPlaneID { get; set; }
|
||||
public int LevelFloorID { get; set; }
|
||||
public int MainMissionID { get; set; }
|
||||
public string MissionJsonPath { get; set; } = "";
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public SubMissionTakeTypeEnum TakeType { get; set; }
|
||||
|
||||
public List<int>? TakeParamIntList { get; set; } = []; // the mission's prerequisites
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public MissionFinishTypeEnum FinishType { get; set; }
|
||||
|
||||
public int ParamInt1 { get; set; }
|
||||
public int ParamInt2 { get; set; }
|
||||
public int ParamInt3 { get; set; }
|
||||
public string ParamStr1 { get; set; } = "";
|
||||
public List<int>? ParamIntList { get; set; } = [];
|
||||
public List<MaterialItem>? ParamItemList { get; set; } = [];
|
||||
public List<FinishActionInfo>? FinishActionList { get; set; } = [];
|
||||
public int Progress { get; set; }
|
||||
public List<int>? GroupIDList { get; set; } = [];
|
||||
public int SubRewardID { get; set; }
|
||||
}
|
||||
|
||||
public class CustomValueInfo
|
||||
{
|
||||
public int Index { get; set; }
|
||||
public List<int> ValidValueParamList { get; set; } = [];
|
||||
}
|
||||
|
||||
public class FinishActionInfo
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public FinishActionTypeEnum FinishActionType { get; set; }
|
||||
|
||||
public List<int> FinishActionPara { get; set; } = [];
|
||||
public List<string> FinishActionParaString { get; set; } = [];
|
||||
}
|
||||
@@ -1,17 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
public class MonsterInfo : PositionInfo
|
||||
{
|
||||
public class MonsterInfo : PositionInfo
|
||||
{
|
||||
public int NPCMonsterID { get; set; }
|
||||
public int EventID { get; set; }
|
||||
public int FarmElementID { get; set; }
|
||||
public bool IsClientOnly { get; set; }
|
||||
}
|
||||
}
|
||||
public int NPCMonsterID { get; set; }
|
||||
public int EventID { get; set; }
|
||||
public int FarmElementID { get; set; }
|
||||
public bool IsClientOnly { get; set; }
|
||||
}
|
||||
@@ -1,15 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
public class NpcInfo : PositionInfo
|
||||
{
|
||||
public class NpcInfo : PositionInfo
|
||||
{
|
||||
public int NPCID { get; set; }
|
||||
public bool IsClientOnly { get; set; }
|
||||
}
|
||||
}
|
||||
public int NPCID { get; set; }
|
||||
public bool IsClientOnly { get; set; }
|
||||
}
|
||||
@@ -1,43 +1,36 @@
|
||||
using EggLink.DanhengServer.Data.Excel;
|
||||
using EggLink.DanhengServer.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using EggLink.DanhengServer.Util;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
public class PositionInfo
|
||||
{
|
||||
public class PositionInfo
|
||||
public int ID { get; set; }
|
||||
public float PosX { get; set; }
|
||||
public float PosY { get; set; }
|
||||
public float PosZ { get; set; }
|
||||
public bool IsDelete { get; set; }
|
||||
public string Name { get; set; } = "";
|
||||
public float RotX { get; set; }
|
||||
public float RotY { get; set; }
|
||||
public float RotZ { get; set; }
|
||||
|
||||
public Position ToPositionProto()
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public float PosX { get; set; }
|
||||
public float PosY { get; set; }
|
||||
public float PosZ { get; set; }
|
||||
public bool IsDelete { get; set; }
|
||||
public string Name { get; set; } = "";
|
||||
public float RotX { get; set; }
|
||||
public float RotY { get; set; }
|
||||
public float RotZ { get; set; }
|
||||
|
||||
public Position ToPositionProto()
|
||||
return new Position
|
||||
{
|
||||
return new()
|
||||
{
|
||||
X = (int)(PosX * 1000f),
|
||||
Y = (int)(PosY * 1000f),
|
||||
Z = (int)(PosZ * 1000f),
|
||||
};
|
||||
}
|
||||
|
||||
public Position ToRotationProto()
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Y = (int)(RotY * 1000f),
|
||||
X = (int)(RotX * 1000f),
|
||||
Z = (int)(RotZ * 1000f),
|
||||
};
|
||||
}
|
||||
X = (int)(PosX * 1000f),
|
||||
Y = (int)(PosY * 1000f),
|
||||
Z = (int)(PosZ * 1000f)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public Position ToRotationProto()
|
||||
{
|
||||
return new Position
|
||||
{
|
||||
Y = (int)(RotY * 1000f),
|
||||
X = (int)(RotX * 1000f),
|
||||
Z = (int)(RotZ * 1000f)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,101 +1,93 @@
|
||||
using EggLink.DanhengServer.Enums.Scene;
|
||||
using EggLink.DanhengServer.Util;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
public class PropInfo : PositionInfo
|
||||
{
|
||||
public class PropInfo : PositionInfo
|
||||
public int MappingInfoID { get; set; }
|
||||
public int AnchorGroupID { get; set; }
|
||||
public int AnchorID { get; set; }
|
||||
public int PropID { get; set; }
|
||||
public int EventID { get; set; }
|
||||
public int CocoonID { get; set; }
|
||||
public int FarmElementID { get; set; }
|
||||
public bool IsClientOnly { get; set; }
|
||||
|
||||
public PropValueSource? ValueSource { get; set; }
|
||||
public string? InitLevelGraph { get; set; }
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public PropStateEnum State { get; set; } = PropStateEnum.Closed;
|
||||
|
||||
[JsonIgnore] public Dictionary<int, List<int>> UnlockDoorID { get; set; } = [];
|
||||
|
||||
[JsonIgnore] public Dictionary<int, List<int>> UnlockControllerID { get; set; } = [];
|
||||
|
||||
[JsonIgnore] public int MazePieceCount { get; set; }
|
||||
|
||||
public void Load(GroupInfo info)
|
||||
{
|
||||
public int MappingInfoID { get; set; }
|
||||
public int AnchorGroupID { get; set; }
|
||||
public int AnchorID { get; set; }
|
||||
public int PropID { get; set; }
|
||||
public int EventID { get; set; }
|
||||
public int CocoonID { get; set; }
|
||||
public int FarmElementID { get; set; }
|
||||
public bool IsClientOnly { get; set; }
|
||||
|
||||
public PropValueSource? ValueSource { get; set; }
|
||||
public string? InitLevelGraph { get; set; }
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public PropStateEnum State { get; set; } = PropStateEnum.Closed;
|
||||
|
||||
[JsonIgnore()]
|
||||
public Dictionary<int, List<int>> UnlockDoorID { get; set; } = [];
|
||||
|
||||
[JsonIgnore()]
|
||||
public Dictionary<int, List<int>> UnlockControllerID { get; set; } = [];
|
||||
|
||||
[JsonIgnore()]
|
||||
public int MazePieceCount { get; set; }
|
||||
|
||||
public void Load(GroupInfo info)
|
||||
{
|
||||
if (ValueSource != null)
|
||||
{
|
||||
foreach (var v in ValueSource.Values)
|
||||
if (ValueSource != null)
|
||||
foreach (var v in ValueSource.Values)
|
||||
try
|
||||
{
|
||||
try
|
||||
var key = v["Key"];
|
||||
var value = v["Value"];
|
||||
if (value != null && key != null)
|
||||
{
|
||||
var key = v["Key"];
|
||||
var value = v["Value"];
|
||||
if (value != null && key != null)
|
||||
if (key.ToString() == "ListenTriggerCustomString")
|
||||
{
|
||||
if (key.ToString() == "ListenTriggerCustomString")
|
||||
info.PropTriggerCustomString.TryGetValue(value.ToString(), out var list);
|
||||
if (list == null)
|
||||
{
|
||||
info.PropTriggerCustomString.TryGetValue(value.ToString(), out var list);
|
||||
if (list == null)
|
||||
{
|
||||
list = [];
|
||||
info.PropTriggerCustomString.Add(value.ToString(), list);
|
||||
}
|
||||
list.Add(ID);
|
||||
list = [];
|
||||
info.PropTriggerCustomString.Add(value.ToString(), list);
|
||||
}
|
||||
else if (key.ToString().Contains("Door") ||
|
||||
key.ToString().Contains("Bridge") ||
|
||||
key.ToString().Contains("UnlockTarget") ||
|
||||
key.ToString().Contains("Rootcontamination") ||
|
||||
key.ToString().Contains("Portal"))
|
||||
|
||||
list.Add(ID);
|
||||
}
|
||||
else if (key.ToString().Contains("Door") ||
|
||||
key.ToString().Contains("Bridge") ||
|
||||
key.ToString().Contains("UnlockTarget") ||
|
||||
key.ToString().Contains("Rootcontamination") ||
|
||||
key.ToString().Contains("Portal"))
|
||||
{
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
if (UnlockDoorID.ContainsKey(int.Parse(value.ToString().Split(",")[0])) == false)
|
||||
{
|
||||
UnlockDoorID.Add(int.Parse(value.ToString().Split(",")[0]), []);
|
||||
}
|
||||
UnlockDoorID[int.Parse(value.ToString().Split(",")[0])].Add(int.Parse(value.ToString().Split(",")[1]));
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
else if (key.ToString().Contains("Controller"))
|
||||
if (UnlockDoorID.ContainsKey(int.Parse(value.ToString().Split(",")[0])) == false)
|
||||
UnlockDoorID.Add(int.Parse(value.ToString().Split(",")[0]), []);
|
||||
UnlockDoorID[int.Parse(value.ToString().Split(",")[0])]
|
||||
.Add(int.Parse(value.ToString().Split(",")[1]));
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
else if (key.ToString().Contains("Controller"))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (UnlockControllerID.ContainsKey(int.Parse(value.ToString().Split(",")[0])) == false)
|
||||
UnlockControllerID.Add(int.Parse(value.ToString().Split(",")[0]), []);
|
||||
UnlockControllerID[int.Parse(value.ToString().Split(",")[0])]
|
||||
.Add(int.Parse(value.ToString().Split(",")[1]));
|
||||
}
|
||||
catch
|
||||
{
|
||||
try
|
||||
{
|
||||
if (UnlockControllerID.ContainsKey(int.Parse(value.ToString().Split(",")[0])) == false)
|
||||
{
|
||||
UnlockControllerID.Add(int.Parse(value.ToString().Split(",")[0]), []);
|
||||
}
|
||||
UnlockControllerID[int.Parse(value.ToString().Split(",")[0])].Add(int.Parse(value.ToString().Split(",")[1]));
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PropValueSource
|
||||
{
|
||||
public List<JObject> Values { get; set; } = [];
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PropValueSource
|
||||
{
|
||||
public List<JObject> Values { get; set; } = [];
|
||||
}
|
||||
@@ -1,74 +1,71 @@
|
||||
using EggLink.DanhengServer.Enums.Rogue;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Orginal Name: RogueChestMapConfig
|
||||
/// </summary>
|
||||
public class RogueChestMapInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Orginal Name: RogueChestMapConfig
|
||||
/// </summary>
|
||||
public class RogueChestMapInfo
|
||||
{
|
||||
public List<int> PreStartRoomIDList { get; set; } = [];
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
public int StartGridItemID { get; set; }
|
||||
public int EndGridItemID { get; set; }
|
||||
public Dictionary<int, RogueChestGridItem> RogueChestGridItemMap { get; set; } = [];
|
||||
public Dictionary<int, RogueChestModifierEvent> RogueChestEventMap { get; set; } = [];
|
||||
public List<RogueBlockCreateGroup> RogueBlockCreateGroupList { get; set; } = [];
|
||||
}
|
||||
|
||||
public class RogueChestGridItem
|
||||
{
|
||||
public int PosX { get; set; }
|
||||
public int PosY { get; set; }
|
||||
|
||||
[JsonProperty(ItemConverterType = typeof(StringEnumConverter))]
|
||||
public List<RogueDLCBlockTypeEnum> BlockTypeList { get; set; } = [];
|
||||
public bool ExportToJson { get; set; }
|
||||
}
|
||||
|
||||
public class RogueChestModifierEvent
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public ModifierTriggerTypeEnum TriggerType { get; set; }
|
||||
public List<int> TriggerParamList { get; set; } = [];
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public ModifierEffectTypeEnum EffectType { get; set; }
|
||||
public List<int> EffectParamList { get; set; } = [];
|
||||
public List<int> EffectParam2List { get; set; } = [];
|
||||
public float Weight { get; set; }
|
||||
}
|
||||
|
||||
public class RogueBlockCreateGroup
|
||||
{
|
||||
public int BlockCreateID { get; set; }
|
||||
public int GroupID { get; set; }
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public RogueDLCBlockTypeEnum BlockType { get; set; }
|
||||
|
||||
public List<RogueDLCBlockWeight> BlockCreatNumList { get; set; } = [];
|
||||
|
||||
public List<RogueDLCMarkType> MarkCreateRandomList { get; set; } = [];
|
||||
}
|
||||
|
||||
public class RogueDLCBlockWeight
|
||||
{
|
||||
public int CreateNum { get; set; }
|
||||
public int Weight { get; set; }
|
||||
}
|
||||
|
||||
public class RogueDLCMarkType
|
||||
{
|
||||
public int TypeID { get; set; }
|
||||
public int Weight { get; set; }
|
||||
}
|
||||
public List<int> PreStartRoomIDList { get; set; } = [];
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
public int StartGridItemID { get; set; }
|
||||
public int EndGridItemID { get; set; }
|
||||
public Dictionary<int, RogueChestGridItem> RogueChestGridItemMap { get; set; } = [];
|
||||
public Dictionary<int, RogueChestModifierEvent> RogueChestEventMap { get; set; } = [];
|
||||
public List<RogueBlockCreateGroup> RogueBlockCreateGroupList { get; set; } = [];
|
||||
}
|
||||
|
||||
public class RogueChestGridItem
|
||||
{
|
||||
public int PosX { get; set; }
|
||||
public int PosY { get; set; }
|
||||
|
||||
[JsonProperty(ItemConverterType = typeof(StringEnumConverter))]
|
||||
public List<RogueDLCBlockTypeEnum> BlockTypeList { get; set; } = [];
|
||||
|
||||
public bool ExportToJson { get; set; }
|
||||
}
|
||||
|
||||
public class RogueChestModifierEvent
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public ModifierTriggerTypeEnum TriggerType { get; set; }
|
||||
|
||||
public List<int> TriggerParamList { get; set; } = [];
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public ModifierEffectTypeEnum EffectType { get; set; }
|
||||
|
||||
public List<int> EffectParamList { get; set; } = [];
|
||||
public List<int> EffectParam2List { get; set; } = [];
|
||||
public float Weight { get; set; }
|
||||
}
|
||||
|
||||
public class RogueBlockCreateGroup
|
||||
{
|
||||
public int BlockCreateID { get; set; }
|
||||
public int GroupID { get; set; }
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public RogueDLCBlockTypeEnum BlockType { get; set; }
|
||||
|
||||
public List<RogueDLCBlockWeight> BlockCreatNumList { get; set; } = [];
|
||||
|
||||
public List<RogueDLCMarkType> MarkCreateRandomList { get; set; } = [];
|
||||
}
|
||||
|
||||
public class RogueDLCBlockWeight
|
||||
{
|
||||
public int CreateNum { get; set; }
|
||||
public int Weight { get; set; }
|
||||
}
|
||||
|
||||
public class RogueDLCMarkType
|
||||
{
|
||||
public int TypeID { get; set; }
|
||||
public int Weight { get; set; }
|
||||
}
|
||||
@@ -1,45 +1,30 @@
|
||||
using EggLink.DanhengServer.Data.Excel;
|
||||
using EggLink.DanhengServer.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
public class SkillAbilityInfo
|
||||
{
|
||||
public class SkillAbilityInfo
|
||||
public List<AbilityInfo> AbilityList { get; set; } = [];
|
||||
|
||||
public void Loaded(AvatarConfigExcel excel)
|
||||
{
|
||||
public List<AbilityInfo> AbilityList { get; set; } = [];
|
||||
|
||||
public void Loaded(AvatarConfigExcel excel)
|
||||
foreach (var ability in AbilityList)
|
||||
{
|
||||
foreach (var ability in AbilityList)
|
||||
{
|
||||
ability.Loaded();
|
||||
if (ability.Name.EndsWith("MazeSkill"))
|
||||
{
|
||||
excel.MazeSkill = ability;
|
||||
}
|
||||
else if (ability.Name.Contains("NormalAtk"))
|
||||
{
|
||||
excel.MazeAtk = ability;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AbilityInfo
|
||||
{
|
||||
public string Name { get; set; } = "";
|
||||
public List<TaskInfo> OnStart { get; set; } = [];
|
||||
|
||||
public void Loaded()
|
||||
{
|
||||
foreach (var task in OnStart)
|
||||
{
|
||||
task.Loaded();
|
||||
}
|
||||
ability.Loaded();
|
||||
if (ability.Name.EndsWith("MazeSkill"))
|
||||
excel.MazeSkill = ability;
|
||||
else if (ability.Name.Contains("NormalAtk")) excel.MazeAtk = ability;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AbilityInfo
|
||||
{
|
||||
public string Name { get; set; } = "";
|
||||
public List<TaskInfo> OnStart { get; set; } = [];
|
||||
|
||||
public void Loaded()
|
||||
{
|
||||
foreach (var task in OnStart) task.Loaded();
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,15 @@
|
||||
using EggLink.DanhengServer.Enums.Task;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
public class ByCompareFloorSavedValue : PredicateConfigInfo
|
||||
{
|
||||
public class ByCompareFloorSavedValue : PredicateConfigInfo
|
||||
{
|
||||
public string Name { get; set; } = "";
|
||||
public string Name { get; set; } = "";
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public CompareTypeEnum CompareType { get; set; } = CompareTypeEnum.Equal;
|
||||
public short CompareValue { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public CompareTypeEnum CompareType { get; set; } = CompareTypeEnum.Equal;
|
||||
|
||||
public short CompareValue { get; set; } = 0;
|
||||
}
|
||||
@@ -1,16 +1,10 @@
|
||||
using EggLink.DanhengServer.Enums.Task;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
public class ByCompareSubMissionState : PredicateConfigInfo
|
||||
{
|
||||
public class ByCompareSubMissionState : PredicateConfigInfo
|
||||
{
|
||||
public int SubMissionID { get; set; }
|
||||
public SubMissionStateEnum SubMissionState { get; set; }
|
||||
public bool AllStoryLine { get; set; }
|
||||
}
|
||||
}
|
||||
public int SubMissionID { get; set; }
|
||||
public SubMissionStateEnum SubMissionState { get; set; }
|
||||
public bool AllStoryLine { get; set; }
|
||||
}
|
||||
@@ -1,15 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
public class CreateProp : TaskConfigInfo
|
||||
{
|
||||
public class CreateProp : TaskConfigInfo
|
||||
{
|
||||
public DynamicFloat GroupID { get; set; } = new();
|
||||
public DynamicFloat GroupPropID { get; set; } = new();
|
||||
public List<GroupEntityInfo> CreateList { get; set; } = [];
|
||||
}
|
||||
}
|
||||
public DynamicFloat GroupID { get; set; } = new();
|
||||
public DynamicFloat GroupPropID { get; set; } = new();
|
||||
public List<GroupEntityInfo> CreateList { get; set; } = [];
|
||||
}
|
||||
@@ -1,32 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
public class DestroyProp : TaskConfigInfo
|
||||
{
|
||||
public class DestroyProp : TaskConfigInfo
|
||||
{
|
||||
public DynamicFloat ID { get; set; } = new();
|
||||
public DynamicFloat GroupID { get; set; } = new();
|
||||
public List<GroupEntityInfo> DestroyList { get; set; } = [];
|
||||
}
|
||||
|
||||
public class GroupEntityInfo
|
||||
{
|
||||
public DynamicFloat GroupID { get; set; } = new();
|
||||
public DynamicFloat GroupInstanceID { get; set; } = new();
|
||||
}
|
||||
|
||||
public class DynamicFloat
|
||||
{
|
||||
public bool IsDynamic { get; set; }
|
||||
public FixedValueInfo<int> FixedValue { get; set; } = new();
|
||||
|
||||
public int GetValue()
|
||||
{
|
||||
return IsDynamic ? 0 : FixedValue.Value;
|
||||
}
|
||||
}
|
||||
public DynamicFloat ID { get; set; } = new();
|
||||
public DynamicFloat GroupID { get; set; } = new();
|
||||
public List<GroupEntityInfo> DestroyList { get; set; } = [];
|
||||
}
|
||||
|
||||
public class GroupEntityInfo
|
||||
{
|
||||
public DynamicFloat GroupID { get; set; } = new();
|
||||
public DynamicFloat GroupInstanceID { get; set; } = new();
|
||||
}
|
||||
|
||||
public class DynamicFloat
|
||||
{
|
||||
public bool IsDynamic { get; set; }
|
||||
public FixedValueInfo<int> FixedValue { get; set; } = new();
|
||||
|
||||
public int GetValue()
|
||||
{
|
||||
return IsDynamic ? 0 : FixedValue.Value;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
public class EnterMap : TaskConfigInfo
|
||||
{
|
||||
public class EnterMap : TaskConfigInfo
|
||||
{
|
||||
public int EntranceID { get; set; }
|
||||
public int GroupID { get; set; }
|
||||
public int AnchorID { get; set; }
|
||||
}
|
||||
}
|
||||
public int EntranceID { get; set; }
|
||||
public int GroupID { get; set; }
|
||||
public int AnchorID { get; set; }
|
||||
}
|
||||
@@ -1,13 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
public class EnterMapByCondition : TaskConfigInfo
|
||||
{
|
||||
public class EnterMapByCondition : TaskConfigInfo
|
||||
{
|
||||
public DynamicFloat EntranceID { get; set; } = new();
|
||||
}
|
||||
}
|
||||
public DynamicFloat EntranceID { get; set; } = new();
|
||||
}
|
||||
@@ -1,13 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
public class PlayMessage : TaskConfigInfo
|
||||
{
|
||||
public class PlayMessage : TaskConfigInfo
|
||||
{
|
||||
public int MessageSectionID { get; set; }
|
||||
}
|
||||
}
|
||||
public int MessageSectionID { get; set; }
|
||||
}
|
||||
@@ -1,33 +1,24 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
public class PredicateConfigInfo : TaskConfigInfo
|
||||
{
|
||||
public class PredicateConfigInfo : TaskConfigInfo
|
||||
public bool Inverse { get; set; } = false;
|
||||
|
||||
public new static PredicateConfigInfo LoadFromJsonObject(JObject obj)
|
||||
{
|
||||
public bool Inverse { get; set; } = false;
|
||||
PredicateConfigInfo info = new();
|
||||
info.Type = obj[nameof(Type)]!.ToObject<string>()!;
|
||||
|
||||
public static new PredicateConfigInfo LoadFromJsonObject(JObject obj)
|
||||
{
|
||||
PredicateConfigInfo info = new();
|
||||
info.Type = obj[nameof(Type)]!.ToObject<string>()!;
|
||||
|
||||
var typeStr = info.Type.Replace("RPG.GameCore.", "");
|
||||
var className = "EggLink.DanhengServer.Data.Config.Task." + typeStr;
|
||||
var typeClass = System.Type.GetType(className);
|
||||
if (typeClass != null)
|
||||
{
|
||||
info = (PredicateConfigInfo)obj.ToObject(typeClass)!;
|
||||
}
|
||||
else
|
||||
{
|
||||
info = Newtonsoft.Json.JsonConvert.DeserializeObject<PredicateConfigInfo>(obj.ToString())!;
|
||||
}
|
||||
return info;
|
||||
}
|
||||
var typeStr = info.Type.Replace("RPG.GameCore.", "");
|
||||
var className = "EggLink.DanhengServer.Data.Config.Task." + typeStr;
|
||||
var typeClass = System.Type.GetType(className);
|
||||
if (typeClass != null)
|
||||
info = (PredicateConfigInfo)obj.ToObject(typeClass)!;
|
||||
else
|
||||
info = JsonConvert.DeserializeObject<PredicateConfigInfo>(obj.ToString())!;
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,27 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
public class PredicateTaskList : TaskConfigInfo
|
||||
{
|
||||
public class PredicateTaskList : TaskConfigInfo
|
||||
public PredicateConfigInfo Predicate { get; set; } = new();
|
||||
public List<TaskConfigInfo> SuccessTaskList { get; set; } = [];
|
||||
public List<TaskConfigInfo> FailedTaskList { get; set; } = [];
|
||||
|
||||
public new static TaskConfigInfo LoadFromJsonObject(JObject obj)
|
||||
{
|
||||
public PredicateConfigInfo Predicate { get; set; } = new();
|
||||
public List<TaskConfigInfo> SuccessTaskList { get; set; } = [];
|
||||
public List<TaskConfigInfo> FailedTaskList { get; set; } = [];
|
||||
PredicateTaskList info = new();
|
||||
info.Type = obj[nameof(Type)]!.ToObject<string>()!;
|
||||
if (obj.ContainsKey(nameof(Predicate)))
|
||||
info.Predicate = PredicateConfigInfo.LoadFromJsonObject((obj[nameof(Predicate)] as JObject)!)!;
|
||||
|
||||
public static new TaskConfigInfo LoadFromJsonObject(JObject obj)
|
||||
{
|
||||
PredicateTaskList info = new();
|
||||
info.Type = obj[nameof(Type)]!.ToObject<string>()!;
|
||||
if (obj.ContainsKey(nameof(Predicate)))
|
||||
{
|
||||
info.Predicate = (PredicateConfigInfo.LoadFromJsonObject((obj[nameof(Predicate)] as JObject)!)!);
|
||||
}
|
||||
if (obj.ContainsKey(nameof(SuccessTaskList)))
|
||||
info.SuccessTaskList = obj[nameof(SuccessTaskList)]
|
||||
?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
|
||||
|
||||
if (obj.ContainsKey(nameof(SuccessTaskList)))
|
||||
{
|
||||
info.SuccessTaskList = obj[nameof(SuccessTaskList)]?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
|
||||
}
|
||||
|
||||
if (obj.ContainsKey(nameof(FailedTaskList)))
|
||||
{
|
||||
info.FailedTaskList = obj[nameof(FailedTaskList)]?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
|
||||
}
|
||||
return info;
|
||||
}
|
||||
if (obj.ContainsKey(nameof(FailedTaskList)))
|
||||
info.FailedTaskList = obj[nameof(FailedTaskList)]
|
||||
?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,68 +1,67 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
public class PropSetupUITrigger : TaskConfigInfo
|
||||
{
|
||||
public class PropSetupUITrigger : TaskConfigInfo
|
||||
{
|
||||
public string ColliderRelativePath { get; set; } = string.Empty;
|
||||
public bool DestroyAfterTriggered { get; set; }
|
||||
public bool DisableAfterTriggered { get; set; }
|
||||
public bool DisableWhenTriggered { get; set; }
|
||||
public string ButtonIcon { get; set; } = string.Empty;
|
||||
//DialogueIconType IconType;
|
||||
//TextID ButtonText;
|
||||
//DynamicString ButtonTextCustom;
|
||||
public List<TaskConfigInfo> ButtonCallback { get; set; } = [];
|
||||
public bool ForceInteractInDanger { get; set; }
|
||||
public bool ConsiderAngleLimit { get; set; }
|
||||
public float InteractAngleRange { get; set; }
|
||||
//EntityType[] OverrideTargetTypes;
|
||||
public bool TriggerByFakeAvatar { get; set; }
|
||||
public bool SkipFakeAvatar { get; set; }
|
||||
public PredicateConfigInfo OnEnterFilter { get; set; } = new();
|
||||
public TargetEvaluator TargetType { get; set; } = new();
|
||||
public string ColliderRelativePath { get; set; } = string.Empty;
|
||||
public bool DestroyAfterTriggered { get; set; }
|
||||
public bool DisableAfterTriggered { get; set; }
|
||||
public bool DisableWhenTriggered { get; set; }
|
||||
|
||||
public static new TaskConfigInfo LoadFromJsonObject(JObject obj)
|
||||
public string ButtonIcon { get; set; } = string.Empty;
|
||||
|
||||
//DialogueIconType IconType;
|
||||
//TextID ButtonText;
|
||||
//DynamicString ButtonTextCustom;
|
||||
public List<TaskConfigInfo> ButtonCallback { get; set; } = [];
|
||||
public bool ForceInteractInDanger { get; set; }
|
||||
public bool ConsiderAngleLimit { get; set; }
|
||||
|
||||
public float InteractAngleRange { get; set; }
|
||||
|
||||
//EntityType[] OverrideTargetTypes;
|
||||
public bool TriggerByFakeAvatar { get; set; }
|
||||
public bool SkipFakeAvatar { get; set; }
|
||||
public PredicateConfigInfo OnEnterFilter { get; set; } = new();
|
||||
public TargetEvaluator TargetType { get; set; } = new();
|
||||
|
||||
public new static TaskConfigInfo LoadFromJsonObject(JObject obj)
|
||||
{
|
||||
PropSetupUITrigger info = new();
|
||||
info.Type = obj[nameof(Type)]!.ToObject<string>()!;
|
||||
|
||||
if (obj.ContainsKey(nameof(OnEnterFilter)))
|
||||
info.OnEnterFilter = PredicateConfigInfo.LoadFromJsonObject((obj[nameof(OnEnterFilter)] as JObject)!)!;
|
||||
|
||||
if (obj.ContainsKey(nameof(ButtonCallback)))
|
||||
info.ButtonCallback = obj[nameof(ButtonCallback)]
|
||||
?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
|
||||
|
||||
if (obj.ContainsKey(nameof(TargetType)))
|
||||
{
|
||||
PropSetupUITrigger info = new();
|
||||
var targetType = obj[nameof(TargetType)] as JObject;
|
||||
var classType =
|
||||
System.Type.GetType(
|
||||
$"EggLink.DanhengServer.Data.Config.Task.{targetType?["Type"]?.ToString().Replace("RPG.GameCore.", "")}");
|
||||
classType ??= System.Type.GetType("EggLink.DanhengServer.Data.Config.Task.TargetEvaluator");
|
||||
info.TargetType = (targetType!.ToObject(classType!) as TargetEvaluator)!;
|
||||
}
|
||||
|
||||
if (info.ButtonCallback.Count > 0 && info.ButtonCallback[0].Type == "RPG.GameCore.PropStateExecute")
|
||||
info.Type = obj[nameof(Type)]!.ToObject<string>()!;
|
||||
|
||||
if (obj.ContainsKey(nameof(OnEnterFilter)))
|
||||
{
|
||||
info.OnEnterFilter = (PredicateConfigInfo.LoadFromJsonObject((obj[nameof(OnEnterFilter)] as JObject)!) as PredicateConfigInfo)!;
|
||||
}
|
||||
info.ColliderRelativePath = obj[nameof(ColliderRelativePath)]?.ToString() ?? string.Empty;
|
||||
info.DestroyAfterTriggered = obj[nameof(DestroyAfterTriggered)]?.ToObject<bool>() ?? false;
|
||||
info.DisableAfterTriggered = obj[nameof(DisableAfterTriggered)]?.ToObject<bool>() ?? false;
|
||||
info.DisableWhenTriggered = obj[nameof(DisableWhenTriggered)]?.ToObject<bool>() ?? false;
|
||||
info.ButtonIcon = obj[nameof(ButtonIcon)]?.ToString() ?? string.Empty;
|
||||
info.ForceInteractInDanger = obj[nameof(ForceInteractInDanger)]?.ToObject<bool>() ?? false;
|
||||
info.ConsiderAngleLimit = obj[nameof(ConsiderAngleLimit)]?.ToObject<bool>() ?? false;
|
||||
info.InteractAngleRange = obj[nameof(InteractAngleRange)]?.ToObject<float>() ?? 0;
|
||||
info.TriggerByFakeAvatar = obj[nameof(TriggerByFakeAvatar)]?.ToObject<bool>() ?? false;
|
||||
info.SkipFakeAvatar = obj[nameof(SkipFakeAvatar)]?.ToObject<bool>() ?? false;
|
||||
|
||||
if (obj.ContainsKey(nameof(ButtonCallback)))
|
||||
{
|
||||
info.ButtonCallback = obj[nameof(ButtonCallback)]?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)).ToList() ?? [];
|
||||
}
|
||||
|
||||
if (obj.ContainsKey(nameof(TargetType)))
|
||||
{
|
||||
var targetType = obj[nameof(TargetType)] as JObject;
|
||||
var classType = System.Type.GetType($"EggLink.DanhengServer.Data.Config.Task.{targetType?["Type"]?.ToString().Replace("RPG.GameCore.","")}");
|
||||
classType ??= System.Type.GetType($"EggLink.DanhengServer.Data.Config.Task.TargetEvaluator");
|
||||
info.TargetType = (targetType!.ToObject(classType!) as TargetEvaluator)!;
|
||||
}
|
||||
|
||||
if (info.ButtonCallback.Count > 0 && info.ButtonCallback[0].Type == "RPG.GameCore.PropStateExecute")
|
||||
{
|
||||
info.Type = obj[nameof(Type)]!.ToObject<string>()!;
|
||||
}
|
||||
|
||||
info.ColliderRelativePath = obj[nameof(ColliderRelativePath)]?.ToString() ?? string.Empty;
|
||||
info.DestroyAfterTriggered = obj[nameof(DestroyAfterTriggered)]?.ToObject<bool>() ?? false;
|
||||
info.DisableAfterTriggered = obj[nameof(DisableAfterTriggered)]?.ToObject<bool>() ?? false;
|
||||
info.DisableWhenTriggered = obj[nameof(DisableWhenTriggered)]?.ToObject<bool>() ?? false;
|
||||
info.ButtonIcon = obj[nameof(ButtonIcon)]?.ToString() ?? string.Empty;
|
||||
info.ForceInteractInDanger = obj[nameof(ForceInteractInDanger)]?.ToObject<bool>() ?? false;
|
||||
info.ConsiderAngleLimit = obj[nameof(ConsiderAngleLimit)]?.ToObject<bool>() ?? false;
|
||||
info.InteractAngleRange = obj[nameof(InteractAngleRange)]?.ToObject<float>() ?? 0;
|
||||
info.TriggerByFakeAvatar = obj[nameof(TriggerByFakeAvatar)]?.ToObject<bool>() ?? false;
|
||||
info.SkipFakeAvatar = obj[nameof(SkipFakeAvatar)]?.ToObject<bool>() ?? false;
|
||||
|
||||
return info;
|
||||
}
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,45 +2,40 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
public class PropStateExecute : TaskConfigInfo
|
||||
{
|
||||
public class PropStateExecute : TaskConfigInfo
|
||||
public TargetEvaluator TargetType { get; set; } = new();
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public PropStateEnum State { get; set; } = PropStateEnum.Closed;
|
||||
|
||||
public List<TaskConfigInfo> Execute { get; set; } = [];
|
||||
|
||||
public new static TaskConfigInfo LoadFromJsonObject(JObject obj)
|
||||
{
|
||||
public TargetEvaluator TargetType { get; set; } = new();
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public PropStateEnum State { get; set; } = PropStateEnum.Closed;
|
||||
public List<TaskConfigInfo> Execute { get; set; } = [];
|
||||
var info = new PropStateExecute();
|
||||
|
||||
public static new TaskConfigInfo LoadFromJsonObject(JObject obj)
|
||||
info.Type = obj[nameof(Type)]!.ToObject<string>()!;
|
||||
if (obj.ContainsKey(nameof(TargetType)))
|
||||
{
|
||||
var info = new PropStateExecute();
|
||||
|
||||
info.Type = obj[nameof(Type)]!.ToObject<string>()!;
|
||||
if (obj.ContainsKey(nameof(TargetType)))
|
||||
{
|
||||
var targetType = obj[nameof(TargetType)] as JObject;
|
||||
var classType = System.Type.GetType($"EggLink.DanhengServer.Data.Config.Task.{targetType?["Type"]?.ToString().Replace("RPG.GameCore.", "")}");
|
||||
classType ??= System.Type.GetType($"EggLink.DanhengServer.Data.Config.Task.TargetEvaluator");
|
||||
info.TargetType = (targetType!.ToObject(classType!) as TargetEvaluator)!;
|
||||
}
|
||||
|
||||
if (obj.ContainsKey(nameof(State)))
|
||||
{
|
||||
info.State = obj[nameof(State)]?.ToObject<PropStateEnum>() ?? PropStateEnum.Closed;
|
||||
}
|
||||
|
||||
foreach (var item in obj[nameof(Execute)]?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)) ?? [])
|
||||
{
|
||||
info.Execute.Add(item);
|
||||
}
|
||||
|
||||
return info;
|
||||
var targetType = obj[nameof(TargetType)] as JObject;
|
||||
var classType =
|
||||
System.Type.GetType(
|
||||
$"EggLink.DanhengServer.Data.Config.Task.{targetType?["Type"]?.ToString().Replace("RPG.GameCore.", "")}");
|
||||
classType ??= System.Type.GetType("EggLink.DanhengServer.Data.Config.Task.TargetEvaluator");
|
||||
info.TargetType = (targetType!.ToObject(classType!) as TargetEvaluator)!;
|
||||
}
|
||||
|
||||
if (obj.ContainsKey(nameof(State)))
|
||||
info.State = obj[nameof(State)]?.ToObject<PropStateEnum>() ?? PropStateEnum.Closed;
|
||||
|
||||
foreach (var item in
|
||||
obj[nameof(Execute)]?.Select(x => TaskConfigInfo.LoadFromJsonObject((x as JObject)!)) ?? [])
|
||||
info.Execute.Add(item);
|
||||
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
public class TargetEvaluator
|
||||
{
|
||||
public class TargetEvaluator
|
||||
{
|
||||
public string Type { get; set; } = "";
|
||||
}
|
||||
}
|
||||
public string Type { get; set; } = "";
|
||||
}
|
||||
@@ -1,25 +1,21 @@
|
||||
using EggLink.DanhengServer.Enums.Task;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
public class TargetFetchAdvPropEx : TargetEvaluator
|
||||
{
|
||||
public class TargetFetchAdvPropEx : TargetEvaluator
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public TargetFetchAdvPropFetchTypeEnum FetchType { get; set; }
|
||||
//public DynamicString SinglePropKey;
|
||||
public FetchAdvPropData SinglePropID { get; set; } = new();
|
||||
//public DynamicString SingleUniqueName;
|
||||
//public DynamicString[] MultiPropKey;
|
||||
//public FetchAdvPropData[] MultiPropID;
|
||||
//public DynamicString[] MultiUniqueName;
|
||||
public DynamicFloat PropGroup { get; set; } = new();
|
||||
public DynamicFloat PropIDInOwnerGroup { get; set; } = new();
|
||||
}
|
||||
}
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public TargetFetchAdvPropFetchTypeEnum FetchType { get; set; }
|
||||
|
||||
//public DynamicString SinglePropKey;
|
||||
public FetchAdvPropData SinglePropID { get; set; } = new();
|
||||
|
||||
//public DynamicString SingleUniqueName;
|
||||
//public DynamicString[] MultiPropKey;
|
||||
//public FetchAdvPropData[] MultiPropID;
|
||||
//public DynamicString[] MultiUniqueName;
|
||||
public DynamicFloat PropGroup { get; set; } = new();
|
||||
public DynamicFloat PropIDInOwnerGroup { get; set; } = new();
|
||||
}
|
||||
@@ -1,52 +1,49 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
public class TaskConfigInfo
|
||||
{
|
||||
public class TaskConfigInfo
|
||||
public string Type { get; set; } = "";
|
||||
public bool TaskEnabled { get; set; } = false;
|
||||
|
||||
public static TaskConfigInfo LoadFromJsonObject(JObject json)
|
||||
{
|
||||
public string Type { get; set; } = "";
|
||||
public bool TaskEnabled { get; set; } = false;
|
||||
var type = json[nameof(Type)]?.Value<string>() ?? "";
|
||||
if (string.IsNullOrEmpty(type)) return new TaskConfigInfo();
|
||||
|
||||
public static TaskConfigInfo LoadFromJsonObject(JObject json)
|
||||
var typeStr = type.Replace("RPG.GameCore.", "");
|
||||
var className = "EggLink.DanhengServer.Data.Config.Task." + typeStr;
|
||||
var typeClass = System.Type.GetType(className);
|
||||
if (typeStr == "PredicateTaskList")
|
||||
{
|
||||
string type = json[nameof(Type)]?.Value<string>() ?? "";
|
||||
if (string.IsNullOrEmpty(type))
|
||||
{
|
||||
return new TaskConfigInfo();
|
||||
}
|
||||
|
||||
var typeStr = type.Replace("RPG.GameCore.", "");
|
||||
var className = "EggLink.DanhengServer.Data.Config.Task." + typeStr;
|
||||
var typeClass = System.Type.GetType(className);
|
||||
if (typeStr == "PredicateTaskList")
|
||||
{
|
||||
var res = PredicateTaskList.LoadFromJsonObject(json);
|
||||
res.Type = type;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (typeStr == "PropSetupUITrigger")
|
||||
{
|
||||
var res = PropSetupUITrigger.LoadFromJsonObject(json);
|
||||
res.Type = type;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (typeStr == "PropStateExecute")
|
||||
{
|
||||
var res = PropStateExecute.LoadFromJsonObject(json);
|
||||
res.Type = type;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (typeClass != null)
|
||||
{
|
||||
var res = (TaskConfigInfo)json.ToObject(typeClass)!;
|
||||
res.Type = type;
|
||||
return res;
|
||||
}
|
||||
|
||||
return Newtonsoft.Json.JsonConvert.DeserializeObject<TaskConfigInfo>(json.ToString())!;
|
||||
var res = PredicateTaskList.LoadFromJsonObject(json);
|
||||
res.Type = type;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (typeStr == "PropSetupUITrigger")
|
||||
{
|
||||
var res = PropSetupUITrigger.LoadFromJsonObject(json);
|
||||
res.Type = type;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (typeStr == "PropStateExecute")
|
||||
{
|
||||
var res = PropStateExecute.LoadFromJsonObject(json);
|
||||
res.Type = type;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (typeClass != null)
|
||||
{
|
||||
var res = (TaskConfigInfo)json.ToObject(typeClass)!;
|
||||
res.Type = type;
|
||||
return res;
|
||||
}
|
||||
|
||||
return JsonConvert.DeserializeObject<TaskConfigInfo>(json.ToString())!;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
public class TriggerCustomString : TaskConfigInfo
|
||||
{
|
||||
public class TriggerCustomString : TaskConfigInfo
|
||||
{
|
||||
public DynamicString CustomString { get; set; } = new();
|
||||
}
|
||||
|
||||
public class DynamicString
|
||||
{
|
||||
public string Value { get; set; } = string.Empty;
|
||||
}
|
||||
public DynamicString CustomString { get; set; } = new();
|
||||
}
|
||||
|
||||
public class DynamicString
|
||||
{
|
||||
public string Value { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -1,13 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
public class TriggerEntityEvent : TaskConfigInfo
|
||||
{
|
||||
public class TriggerEntityEvent : TaskConfigInfo
|
||||
{
|
||||
public DynamicFloat InstanceID { get; set; } = new();
|
||||
}
|
||||
}
|
||||
public DynamicFloat InstanceID { get; set; } = new();
|
||||
}
|
||||
@@ -1,18 +1,13 @@
|
||||
using EggLink.DanhengServer.Enums.Task;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config.Task
|
||||
namespace EggLink.DanhengServer.Data.Config.Task;
|
||||
|
||||
public class TriggerPerformance : TaskConfigInfo
|
||||
{
|
||||
public class TriggerPerformance : TaskConfigInfo
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public ELevelPerformanceTypeEnum PerformanceType { get; set; }
|
||||
public int PerformanceID { get; set; }
|
||||
}
|
||||
}
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public ELevelPerformanceTypeEnum PerformanceType { get; set; }
|
||||
|
||||
public int PerformanceID { get; set; }
|
||||
}
|
||||
@@ -1,125 +1,82 @@
|
||||
using EggLink.DanhengServer.Enums.Avatar;
|
||||
using EggLink.DanhengServer.Util;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Config
|
||||
namespace EggLink.DanhengServer.Data.Config;
|
||||
|
||||
public class TaskInfo
|
||||
{
|
||||
public class TaskInfo
|
||||
public string Type { get; set; } = "";
|
||||
|
||||
public int ID { get; set; }
|
||||
public int SummonUnitID { get; set; }
|
||||
|
||||
// Here's a conflict between Dimbreath's res and Andy's res ( we recommend to use the one from Andy's res )
|
||||
public bool TriggerBattle { get; set; } = false;
|
||||
|
||||
public List<TaskInfo> OnAttack { get; set; } = [];
|
||||
public List<TaskInfo> OnBattle { get; set; } = [];
|
||||
public List<TaskInfo> SuccessTaskList { get; set; } = [];
|
||||
public List<TaskInfo> OnProjectileHit { get; set; } = [];
|
||||
public List<TaskInfo> OnProjectileLifetimeFinish { get; set; } = [];
|
||||
|
||||
public LifeTimeInfo LifeTime { get; set; } = new();
|
||||
|
||||
[JsonIgnore] public TaskTypeEnum TaskType { get; set; } = TaskTypeEnum.None;
|
||||
|
||||
public void Loaded()
|
||||
{
|
||||
public string Type { get; set; } = "";
|
||||
|
||||
public int ID { get; set; }
|
||||
public int SummonUnitID { get; set; }
|
||||
|
||||
// Here's a conflict between Dimbreath's res and Andy's res ( we recommend to use the one from Andy's res )
|
||||
public bool TriggerBattle { get; set; } = false;
|
||||
|
||||
public List<TaskInfo> OnAttack { get; set; } = [];
|
||||
public List<TaskInfo> OnBattle { get; set; } = [];
|
||||
public List<TaskInfo> SuccessTaskList { get; set; } = [];
|
||||
public List<TaskInfo> OnProjectileHit { get; set; } = [];
|
||||
public List<TaskInfo> OnProjectileLifetimeFinish { get; set; } = [];
|
||||
|
||||
public LifeTimeInfo LifeTime { get; set; } = new();
|
||||
|
||||
[JsonIgnore]
|
||||
public TaskTypeEnum TaskType { get; set; } = TaskTypeEnum.None;
|
||||
|
||||
public void Loaded()
|
||||
{
|
||||
foreach (var task in OnAttack)
|
||||
{
|
||||
task.Loaded();
|
||||
}
|
||||
foreach (var task in OnBattle)
|
||||
{
|
||||
task.Loaded();
|
||||
}
|
||||
foreach (var task in SuccessTaskList)
|
||||
{
|
||||
task.Loaded();
|
||||
}
|
||||
foreach (var task in OnProjectileHit)
|
||||
{
|
||||
task.Loaded();
|
||||
}
|
||||
foreach (var task in OnProjectileLifetimeFinish)
|
||||
{
|
||||
task.Loaded();
|
||||
}
|
||||
if (Type.Contains("AddMazeBuff"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.AddMazeBuff;
|
||||
} else if (Type.Contains("RemoveMazeBuff"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.RemoveMazeBuff;
|
||||
} else if (Type.Contains("AdventureModifyTeamPlayerHP"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.AdventureModifyTeamPlayerHP;
|
||||
} else if (Type.Contains("AdventureModifyTeamPlayerSP"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.AdventureModifyTeamPlayerSP;
|
||||
} else if (Type.Contains("CreateSummonUnit"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.CreateSummonUnit;
|
||||
} else if (Type.Contains("AdventureSetAttackTargetMonsterDie"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.AdventureSetAttackTargetMonsterDie;
|
||||
} else if (SuccessTaskList.Count > 0)
|
||||
{
|
||||
TaskType = TaskTypeEnum.SuccessTaskList;
|
||||
}
|
||||
else if (Type.Contains("AdventureTriggerAttack"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.AdventureTriggerAttack;
|
||||
} else if (Type.Contains("AdventureFireProjectile"))
|
||||
{
|
||||
TaskType = TaskTypeEnum.AdventureFireProjectile;
|
||||
}
|
||||
}
|
||||
|
||||
public int GetID()
|
||||
{
|
||||
return ID > 0 ? ID : SummonUnitID;
|
||||
}
|
||||
|
||||
public List<TaskInfo> GetAttackInfo()
|
||||
{
|
||||
var attackInfo = new List<TaskInfo>();
|
||||
attackInfo.AddRange(OnAttack);
|
||||
attackInfo.AddRange(OnBattle);
|
||||
return attackInfo;
|
||||
}
|
||||
foreach (var task in OnAttack) task.Loaded();
|
||||
foreach (var task in OnBattle) task.Loaded();
|
||||
foreach (var task in SuccessTaskList) task.Loaded();
|
||||
foreach (var task in OnProjectileHit) task.Loaded();
|
||||
foreach (var task in OnProjectileLifetimeFinish) task.Loaded();
|
||||
if (Type.Contains("AddMazeBuff"))
|
||||
TaskType = TaskTypeEnum.AddMazeBuff;
|
||||
else if (Type.Contains("RemoveMazeBuff"))
|
||||
TaskType = TaskTypeEnum.RemoveMazeBuff;
|
||||
else if (Type.Contains("AdventureModifyTeamPlayerHP"))
|
||||
TaskType = TaskTypeEnum.AdventureModifyTeamPlayerHP;
|
||||
else if (Type.Contains("AdventureModifyTeamPlayerSP"))
|
||||
TaskType = TaskTypeEnum.AdventureModifyTeamPlayerSP;
|
||||
else if (Type.Contains("CreateSummonUnit"))
|
||||
TaskType = TaskTypeEnum.CreateSummonUnit;
|
||||
else if (Type.Contains("AdventureSetAttackTargetMonsterDie"))
|
||||
TaskType = TaskTypeEnum.AdventureSetAttackTargetMonsterDie;
|
||||
else if (SuccessTaskList.Count > 0)
|
||||
TaskType = TaskTypeEnum.SuccessTaskList;
|
||||
else if (Type.Contains("AdventureTriggerAttack"))
|
||||
TaskType = TaskTypeEnum.AdventureTriggerAttack;
|
||||
else if (Type.Contains("AdventureFireProjectile")) TaskType = TaskTypeEnum.AdventureFireProjectile;
|
||||
}
|
||||
|
||||
public class LifeTimeInfo
|
||||
public int GetID()
|
||||
{
|
||||
public bool IsDynamic { get; set; } = false;
|
||||
public FixedValueInfo<double> FixedValue { get; set; } = new();
|
||||
|
||||
public int GetLifeTime()
|
||||
{
|
||||
if (IsDynamic)
|
||||
{
|
||||
return 20; // find a better way to get the value
|
||||
}
|
||||
if (FixedValue.Value <= 0)
|
||||
{
|
||||
return -1; // infinite
|
||||
}
|
||||
return (int)(FixedValue.Value * 10);
|
||||
}
|
||||
return ID > 0 ? ID : SummonUnitID;
|
||||
}
|
||||
|
||||
public class FixedValueInfo<T>
|
||||
public List<TaskInfo> GetAttackInfo()
|
||||
{
|
||||
public T Value { get; set; } = default!;
|
||||
var attackInfo = new List<TaskInfo>();
|
||||
attackInfo.AddRange(OnAttack);
|
||||
attackInfo.AddRange(OnBattle);
|
||||
return attackInfo;
|
||||
}
|
||||
}
|
||||
|
||||
public class LifeTimeInfo
|
||||
{
|
||||
public bool IsDynamic { get; set; } = false;
|
||||
public FixedValueInfo<double> FixedValue { get; set; } = new();
|
||||
|
||||
public int GetLifeTime()
|
||||
{
|
||||
if (IsDynamic) return 20; // find a better way to get the value
|
||||
if (FixedValue.Value <= 0) return -1; // infinite
|
||||
return (int)(FixedValue.Value * 10);
|
||||
}
|
||||
}
|
||||
|
||||
public class FixedValueInfo<T>
|
||||
{
|
||||
public T Value { get; set; } = default!;
|
||||
}
|
||||
Reference in New Issue
Block a user