Skip to content

Commit 229f3ff

Browse files
v1.9.1 mox
1 parent bd7171f commit 229f3ff

File tree

7 files changed

+87
-11
lines changed

7 files changed

+87
-11
lines changed

API.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<AssemblyName>API</AssemblyName>
66
<Description>An API for inscryption</Description>
7-
<Version>1.9.0.0</Version>
7+
<Version>1.9.1.0</Version>
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
99
<LangVersion>9.0</LangVersion>
1010
</PropertyGroup>

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Changelog
2+
## v1.9.1
3+
- Added support for mox.
4+
- Forced ability texture to point filter.
5+
26
## v1.9
37
- Added config options for energy.
48

Models/NewAbility.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public NewAbility(AbilityInfo info, Type abilityBehaviour, Texture tex)
1919
info.ability = this.ability;
2020
this.info = info;
2121
this.abilityBehaviour = abilityBehaviour;
22+
tex.filterMode = FilterMode.Point;
2223
this.tex = tex;
2324
NewAbility.abilities.Add(this);
2425
Plugin.Log.LogInfo($"Loaded custom ability {info.rulebookName}!");

Models/NewCard.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static void Add(string name, List<CardMetaCategory> metaCategories, CardC
3333
{
3434
CardInfo card = ScriptableObject.CreateInstance<CardInfo>();
3535

36-
// names / descryptions
36+
// names / descriptions
3737
card.defaultEvolutionName = defaultEvolutionName;
3838
card.displayedName = displayedName;
3939
card.name = name;

Patches/Energy.cs

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313

1414
namespace API.Patches
1515
{
16+
[HarmonyPatch(typeof(ResourceDrone), "SetOnBoard")]
17+
public class ResourceDrone_SetOnBoard
18+
{
19+
public static void Postfix(ResourceDrone __instance)
20+
{
21+
__instance.Gems.gameObject.SetActive(Plugin.configDroneMox.Value);
22+
}
23+
}
24+
1625
[HarmonyPatch(typeof(Part1ResourcesManager), "CleanUp")]
1726
public class Part1ResourcesManager_CleanUp
1827
{
@@ -21,14 +30,23 @@ public static void Prefix(Part1ResourcesManager __instance)
2130
ResourcesManager baseResourceManager = (ResourcesManager) __instance;
2231
if (Plugin.configEnergy.Value)
2332
{
24-
var baseTraverse = Traverse.Create(baseResourceManager);
25-
baseTraverse.Property("PlayerEnergy").SetValue(0);
26-
baseTraverse.Property("PlayerMaxEnergy").SetValue(0);
33+
var baseTraverse = Traverse.Create(baseResourceManager);
34+
baseTraverse.Property("PlayerEnergy").SetValue(0);
35+
baseTraverse.Property("PlayerMaxEnergy").SetValue(0);
2736
}
2837
if ( Plugin.configDrone.Value)
2938
{
39+
Singleton<ResourceDrone>.Instance.Gems.SetAllGemsOn(false, false);
3040
Singleton<ResourceDrone>.Instance.CloseAllCells(false);
3141
Singleton<ResourceDrone>.Instance.SetOnBoard(false, false);
42+
if (Plugin.configDroneMox.Value)
43+
{
44+
Singleton<ResourceDrone>.Instance.Gems.SetAllGemsOn(false, false);
45+
}
46+
}
47+
if (Plugin.configMox.Value)
48+
{
49+
__instance.gems.Clear();
3250
}
3351
}
3452
}
@@ -41,6 +59,10 @@ public static void Prefix(ResourcesManager __instance)
4159
if (__instance is Part1ResourcesManager && Plugin.configDrone.Value)
4260
{
4361
Singleton<ResourceDrone>.Instance.SetOnBoard(true, false);
62+
if (Plugin.configDroneMox.Value)
63+
{
64+
Singleton<ResourceDrone>.Instance.Gems.SetAllGemsOn(false, true);
65+
}
4466
}
4567
}
4668
}
@@ -98,6 +120,43 @@ public static IEnumerator Postfix(IEnumerator result, int amount, ResourcesManag
98120
}
99121
}
100122

123+
[HarmonyPatch(typeof(ResourcesManager), "ShowAddGem")]
124+
public class ResourcesManager_ShowAddGem
125+
{
126+
public static IEnumerator Postfix(IEnumerator result, GemType gem, ResourcesManager __instance)
127+
{
128+
if (__instance is Part1ResourcesManager && Plugin.configDroneMox.Value)
129+
{
130+
__instance.SetGemOnImmediate(gem, true);
131+
yield return new WaitForSeconds(0.05f);
132+
}
133+
yield return result;
134+
}
135+
}
136+
137+
[HarmonyPatch(typeof(ResourcesManager), "ShowLoseGem")]
138+
public class ResourcesManager_ShowLoseGem
139+
{
140+
public static IEnumerator Postfix(IEnumerator result, GemType gem, ResourcesManager __instance)
141+
{
142+
if (__instance is Part1ResourcesManager && Plugin.configDroneMox.Value)
143+
{
144+
__instance.SetGemOnImmediate(gem, false);
145+
yield return new WaitForSeconds(0.05f);
146+
}
147+
yield return result;
148+
}
149+
}
150+
151+
[HarmonyPatch(typeof(ResourcesManager), "SetGemOnImmediate")]
152+
public class ResourcesManager_SetGemOnImmediate
153+
{
154+
public static void Postfix(GemType gem, bool on)
155+
{
156+
Singleton<ResourceDrone>.Instance.Gems.SetGemOn(gem, on, false);
157+
}
158+
}
159+
101160
[HarmonyPatch]
102161
public class TurnManager_PlayerTurn
103162
{

Plugin.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ public class Plugin : BaseUnityPlugin
1616
{
1717
private const string PluginGuid = "cyantist.inscryption.api";
1818
private const string PluginName = "API";
19-
private const string PluginVersion = "1.9.0.0";
19+
private const string PluginVersion = "1.9.1.0";
2020

2121
internal static ManualLogSource Log;
2222
internal static ConfigEntry<bool> configEnergy;
2323
internal static ConfigEntry<bool> configDrone;
24+
internal static ConfigEntry<bool> configMox;
25+
internal static ConfigEntry<bool> configDroneMox;
2426

2527
private void Awake()
2628
{
@@ -31,10 +33,18 @@ private void Awake()
3133
"Energy Refresh",
3234
false,
3335
"Max energy increaces and energy refreshes at end of turn");
34-
configDrone = Config.Bind("Energy",
35-
"Energy Drone",
36-
false,
37-
"Drone is visible to display energy");
36+
configDrone = Config.Bind("Energy",
37+
"Energy Drone",
38+
false,
39+
"Drone is visible to display energy (requires Energy Refresh)");
40+
configMox = Config.Bind("Mox",
41+
"Mox Refresh",
42+
false,
43+
"Mox refreshes at end of battle");
44+
configDroneMox = Config.Bind("Mox",
45+
"Mox Drone",
46+
false,
47+
"Drone displays mox (requires Energy Drone and Mox Refresh)");
3848
Harmony harmony = new Harmony(PluginGuid);
3949
harmony.PatchAll();
4050
}
@@ -60,6 +70,8 @@ private IEnumerator AwakeDrone()
6070
{
6171
yield return new WaitForSeconds(1);
6272
Singleton<ResourceDrone>.Instance.Awake();
73+
yield return new WaitForSeconds(1);
74+
Singleton<ResourceDrone>.Instance.AttachGemsModule();
6375
}
6476
}
6577
}

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "API",
3-
"version_number": "1.9.0",
3+
"version_number": "1.9.1",
44
"website_url": "https://github.com/ScottWilson0903/InscryptionAPI",
55
"description": "This plugin is a BepInEx plugin made for Inscryption as an API. It can currently create custom cards and abilities and inject them into the data pool, or modify existing cards in the card pool.",
66
"dependencies": [

0 commit comments

Comments
 (0)