Skip to content

Commit 4d3a5f5

Browse files
EnergyConfigInfo fields can now be modified when initialising a new one, added GetEnergyConfig method
1 parent c5b2f45 commit 4d3a5f5

3 files changed

Lines changed: 36 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<summary>View Changelog</summary>
33

44
# 2.22.2
5+
- Added GetEnergyConfig method to community patch's EnergyDrone class - retrieves the current Act's EnergyConfigInfo
56
- Fixed positioning errors caused by having multiple custom boss challenge icons
7+
- EnergyConfigInfo's fields can now be modified when initialising a new instance
8+
- Updated installation guide on the ReadMe to match the wiki, added link to wiki.
69

710
# 2.22.1
811
- Added IShieldPreventedDamage and IShieldPreventedDamageInHand ability triggers and interfaces

InscryptionCommunityPatch/InscryptionCommunityPatch.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1010
<DebugType>full</DebugType>
1111
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
12-
<Version>2.21.0</Version>
12+
<Version>2.22.0</Version>
1313
</PropertyGroup>
1414

1515
<PropertyGroup>

InscryptionCommunityPatch/ResourceManagers/ActOneEnergyDrone.cs

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,26 @@ namespace InscryptionCommunityPatch.ResourceManagers;
1111
[HarmonyPatch]
1212
public static class EnergyDrone
1313
{
14+
/// <summary>
15+
/// Class containing information on the resource energy drone. Controls whether the Energy Drone will appear in non-Act 3 acts.
16+
/// </summary>
1417
public class EnergyConfigInfo
1518
{
16-
public bool ConfigEnergy => PoolHasEnergy || PatchPlugin.configEnergy.Value;
17-
public bool ConfigDrone => PoolHasEnergy || ConfigDroneMox || PatchPlugin.configDrone.Value;
18-
public bool ConfigDroneMox => PoolHasGems || PatchPlugin.configDroneMox.Value;
19-
public bool ConfigMox => PoolHasGems || PatchPlugin.configMox.Value;
20-
public bool ConfigDefaultDrone => PatchPlugin.configDefaultDrone.Value;
19+
public bool ConfigEnergy { get; set; } = PoolHasEnergy || PatchPlugin.configEnergy.Value;
20+
public bool ConfigShowDrone { get; set; } = PoolHasEnergy || PatchPlugin.configDrone.Value;
21+
public bool ConfigDroneMox { get; set; } = PoolHasGems || PatchPlugin.configDroneMox.Value;
22+
public bool ConfigMox { get; set; } = PoolHasGems || PatchPlugin.configMox.Value;
23+
public bool ConfigDefaultDrone { get; set; } = PatchPlugin.configDefaultDrone.Value;
24+
25+
/// <summary>
26+
/// Controls whether or not the Drone will appear. By default, will appear if there are obtainable Energy or Mox cards in the card pool (or the corresponding config value has been set).
27+
/// </summary>
28+
public bool ConfigDrone => ConfigShowDrone || ConfigDroneMox;
2129
}
2230

31+
/// <summary>
32+
/// Contains the EnergyConfigInfos for each Act with default settings. If you want to directly alter an Act's drone behaviour, please modify GetEnergyConfig instead.
33+
/// </summary>
2334
public static Dictionary<CardTemple, EnergyConfigInfo> ZoneConfigs = new()
2435
{
2536
{ CardTemple.Nature, new() },
@@ -49,23 +60,28 @@ public static bool CurrentSceneCanHaveEnergyDrone
4960
}
5061
}
5162

52-
private static EnergyConfigInfo EnergyConfig
63+
/// <summary>
64+
/// Returns the EnergyConfigInfo object corresponding to the current Act.
65+
/// </summary>
66+
public static EnergyConfigInfo GetEnergyConfig()
5367
{
54-
get
55-
{
56-
if (SaveManager.SaveFile.IsPart3)
57-
return ZoneConfigs[CardTemple.Tech];
68+
if (SaveManager.SaveFile.IsPart3)
69+
return ZoneConfigs[CardTemple.Tech];
5870

59-
if (SaveManager.SaveFile.IsGrimora)
60-
return ZoneConfigs[CardTemple.Undead];
71+
if (SaveManager.SaveFile.IsGrimora)
72+
return ZoneConfigs[CardTemple.Undead];
6173

62-
if (SaveManager.SaveFile.IsMagnificus)
63-
return ZoneConfigs[CardTemple.Wizard];
74+
if (SaveManager.SaveFile.IsMagnificus)
75+
return ZoneConfigs[CardTemple.Wizard];
6476

65-
return ZoneConfigs[CardTemple.Nature];
66-
}
77+
return ZoneConfigs[CardTemple.Nature];
6778
}
6879

80+
/// <summary>
81+
/// The EnergyConfigInfo for the current Act.
82+
/// </summary>
83+
private static EnergyConfigInfo EnergyConfig => GetEnergyConfig();
84+
6985
public static bool PoolHasEnergy { get; private set; }
7086
public static bool PoolHasGems { get; private set; }
7187

0 commit comments

Comments
 (0)