diff --git a/Modules/ModuleStore.cs b/Modules/ModuleStore.cs index ce6a5642..a17287f1 100644 --- a/Modules/ModuleStore.cs +++ b/Modules/ModuleStore.cs @@ -826,6 +826,18 @@ public static class ModuleLogic return; } + if (key.StartsWith("auras.", StringComparison.OrdinalIgnoreCase)) + { + GetOrCreateMutableDict(state, "auras")[key["auras.".Length..]] = value; + return; + } + + if (key.StartsWith("spells.", StringComparison.OrdinalIgnoreCase)) + { + GetOrCreateMutableDict(state, "spells")[key["spells.".Length..]] = value; + return; + } + GetOrCreateDynamicValues(state)[key] = value; } @@ -851,6 +863,28 @@ public static class ModuleLogic return values; } + private static Dictionary GetOrCreateMutableDict(GameState state, string dictKey) + { + if (state.Values.TryGetValue(dictKey, out var obj)) + { + if (obj is Dictionary mutable) + { + return mutable; + } + + if (obj is IReadOnlyDictionary readOnly) + { + var copy = new Dictionary(readOnly, StringComparer.Ordinal); + state.Values[dictKey] = copy; + return copy; + } + } + + var dict = new Dictionary(StringComparer.Ordinal); + state.Values[dictKey] = dict; + return dict; + } + private static void ApplyValueDelta(GameState state, string field, int delta) { var key = field.Trim(); @@ -859,6 +893,24 @@ public static class ModuleLogic return; } + if (key.StartsWith("auras.", StringComparison.OrdinalIgnoreCase)) + { + var auraKey = key["auras.".Length..]; + var dict = GetOrCreateMutableDict(state, "auras"); + var current = dict.TryGetValue(auraKey, out var v) ? v : null; + dict[auraKey] = AddDelta(current, delta); + return; + } + + if (key.StartsWith("spells.", StringComparison.OrdinalIgnoreCase)) + { + var spellKey = key["spells.".Length..]; + var dict = GetOrCreateMutableDict(state, "spells"); + var current = dict.TryGetValue(spellKey, out var v) ? v : null; + dict[spellKey] = AddDelta(current, delta); + return; + } + if (state.Values.TryGetValue("$counts", out var countsObj) && countsObj is Dictionary counts && counts.TryGetValue(key, out var countValue)) diff --git a/module/戒律队伍神谕者-by-Wayne.json b/module/戒律队伍神谕者-by-Wayne.json index b34b7302..74f26c17 100644 --- a/module/戒律队伍神谕者-by-Wayne.json +++ b/module/戒律队伍神谕者-by-Wayne.json @@ -97,14 +97,7 @@ { "Enabled": true, "Condition": "施法技能 == 34", - "Field": "auras.暗影层数", - "Delta": -1, - "Formula": "" - }, - { - "Enabled": true, - "Condition": "施法技能 == 34", - "Field": "涌动层数", + "Field": "auras.愈合层数", "Delta": -1, "Formula": "" }, @@ -128,6 +121,13 @@ "Field": "有救赎数量", "Delta": 4, "Formula": "" + }, + { + "Enabled": true, + "Condition": "施法技能 == 29", + "Field": "auras.愈合层数", + "Delta": 10, + "Formula": "" } ], "Rules": [ diff --git a/打包说明.md b/打包说明.md index 3f3f4d0f..ebf2e703 100644 --- a/打包说明.md +++ b/打包说明.md @@ -42,7 +42,7 @@ 打开 `Shigure.csproj`,找到: ```xml -Arasaka Shigure +Shigure ``` 把中间的名字改成你想要的名字,例如: @@ -109,13 +109,13 @@ artifacts\publish\win-x64 例如当前配置是: ```xml -Arasaka Shigure +Shigure ``` 那么 exe 文件就是: ```text -artifacts\publish\win-x64\Arasaka Shigure.exe +artifacts\publish\win-x64\Shigure.exe ``` 如果你把 `AssemblyName` 改成了 `Arasaka Shingen`,则文件会变成: