-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
109 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using lib.remnant2.saves.Model; | ||
using lib.remnant2.saves.Model.Properties; | ||
using lib.remnant2.saves.Navigation; | ||
|
||
namespace lib.remnant2.analyzer.Model.Mechanics; | ||
|
||
public class BloodMoon | ||
{ | ||
public double CurrentChance { get; set; } | ||
public DateTime LastTriggeredTime { get; set; } | ||
public DateTime LastCheckTime { get; set; } | ||
public int ZoneLoadCount { get; set; } | ||
public Dictionary<string, string> StringifiedRawData = []; | ||
|
||
public static BloodMoon? Read(Navigator n) | ||
{ | ||
List<UObject> oo = n.FindObjects("Quest_Event_Bloodmoon_C"); | ||
if (oo.Count == 0) return null; | ||
Component? c =oo[0].Components?.FirstOrDefault(x => x.ComponentKey == "BloodMoon"); | ||
if (c == null) return null; | ||
PropertyBag? pb = c.Properties; | ||
if (pb == null) return null; | ||
BloodMoon result = new() | ||
{ | ||
StringifiedRawData = pb.Properties.ToDictionary(x => x.Key, x => x.Value.ToString()) | ||
}; | ||
if (result.StringifiedRawData.Count == 0) return null; | ||
if (pb.Contains("CurrentChance")) | ||
{ | ||
result.CurrentChance = pb["CurrentChance"].Get<double>(); | ||
} | ||
if (pb.Contains("LastTriggeredTime")) | ||
{ | ||
result.LastTriggeredTime = (DateTime)pb["LastTriggeredTime"].Get<StructProperty>().Value!; | ||
} | ||
if (pb.Contains("LastCheckTime")) | ||
{ | ||
result.LastCheckTime = (DateTime)pb["LastCheckTime"].Get<StructProperty>().Value!; | ||
} | ||
if (pb.Contains("ZoneLoadCount")) | ||
{ | ||
result.ZoneLoadCount = pb["ZoneLoadCount"].Get<int>(); | ||
} | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using lib.remnant2.saves.Model; | ||
using lib.remnant2.saves.Model.Properties; | ||
using lib.remnant2.saves.Navigation; | ||
|
||
namespace lib.remnant2.analyzer.Model.Mechanics; | ||
public class ThaenFruit | ||
{ | ||
public int GrowthStage { get; set; } | ||
public DateTime Timestamp { get; set; } | ||
public bool HasFruit { get; set; } | ||
public int PickedCount { get; set; } | ||
public Dictionary<string,string> StringifiedRawData = []; | ||
|
||
public static ThaenFruit? Read(Navigator n) | ||
{ | ||
UObject? o = n.GetObject("pc:/Game/Zone_1_Template.Ward13_Town:PersistentLevel"); | ||
if (o == null || o.Properties == null) return null; | ||
if (o.Properties.Properties[1].Value.Value is not StructProperty sp) return null; | ||
if (sp.Value is not PersistenceContainer pc) return null; | ||
PropertyBag? pb = pc.Actors.SingleOrDefault(x=> x.Key == 55).Value.GetFirstObjectProperties(); | ||
if (pb == null) return null; | ||
ThaenFruit result = new() | ||
{ | ||
StringifiedRawData = pb.Properties.ToDictionary(x => x.Key, x => x.Value.ToString()) | ||
}; | ||
if (result.StringifiedRawData.Count == 0) return null; | ||
if (pb.Contains("GrowthStage")) | ||
{ | ||
result.GrowthStage = pb["GrowthStage"].Get<int>(); | ||
} | ||
if (pb.Contains("Timestamp")) | ||
{ | ||
result.Timestamp = (DateTime)pb["Timestamp"].Get<StructProperty>().Value!; | ||
} | ||
if (pb.Contains("HasFruit")) | ||
{ | ||
result.HasFruit = pb["HasFruit"].Get<byte>() != 0; | ||
} | ||
if (pb.Contains("PickedCount")) | ||
{ | ||
result.PickedCount = pb["PickedCount"].Get<int>(); | ||
} | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters