Skip to content

Commit 8cb4333

Browse files
committed
Fix for JSONLoader
1 parent d5a63e6 commit 8cb4333

3 files changed

Lines changed: 4 additions & 51 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## v1.13.2-kaycee
4+
- Fix for JSONLoader cards
5+
36
## v1.13.1-kaycee
47
- Fixes to Ascension Mode
58

Utils/IdentifierHandlers.cs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ public partial class Plugin
88
{
99
private void SetAbilityIdentifiers()
1010
{
11-
ImportCustomAbilities();
12-
1311
Log.LogDebug($"Number of ability IDs to set from NewCard.abilityIds: [{NewCard.abilityIds.Count}]");
1412
foreach(var item in NewCard.abilityIds)
1513
{
@@ -49,54 +47,6 @@ private void SetAbilityIdentifiers()
4947
}
5048
}
5149
}
52-
53-
ImportCustomCards();
54-
}
55-
56-
private static void ImportCustomAbilities()
57-
{
58-
Plugin.Log.LogDebug($"Starting pre-emptive data load for AbilityInfo before adding custom abilities...");
59-
List<AbilityInfo> officialAbilityInfo = ScriptableObjectLoader<AbilityInfo>.AllData;
60-
61-
foreach (NewAbility newAbility in NewAbility.abilities)
62-
{
63-
officialAbilityInfo.Add(newAbility.info);
64-
Plugin.Log.LogDebug($"Official ability list now contains [{newAbility.info.rulebookName}]!");
65-
}
66-
67-
ScriptableObjectLoader<AbilityInfo>.allData = officialAbilityInfo;
68-
Plugin.Log.LogInfo($"Loaded {NewAbility.abilities.Count} custom abilities into data! " +
69-
$"Total of [{ScriptableObjectLoader<AbilityInfo>.allData.Count}]");
70-
}
71-
72-
private static void ImportCustomCards()
73-
{
74-
Plugin.Log.LogDebug($"Starting pre-emptive data load for CardInfo before adding modified and new cards...");
75-
List<CardInfo> officialCardInfo = ScriptableObjectLoader<CardInfo>.AllData;
76-
Plugin.Log.LogDebug($"CustomCards count [{CustomCard.cards.Count}] NewCard.cards count [{NewCard.cards.Count}]");
77-
foreach (CustomCard card in CustomCard.cards)
78-
{
79-
int index = officialCardInfo.FindIndex((CardInfo x) => x.name == card.name);
80-
if (index == -1)
81-
{
82-
Plugin.Log.LogWarning($"Could not find card {card.name} to modify");
83-
}
84-
else
85-
{
86-
officialCardInfo[index] = card.AdjustCard(officialCardInfo[index]);
87-
Plugin.Log.LogInfo($"Loaded modified [{card.name}] into data");
88-
}
89-
}
90-
91-
ScriptableObjectLoader<CardInfo>.allData = officialCardInfo.Concat(
92-
NewCard.cards.Select(cardInfo =>
93-
{
94-
Log.LogInfo($"Loaded custom card to card pool: [{cardInfo.name}]");
95-
return cardInfo;
96-
}
97-
)
98-
).ToList();
99-
Plugin.Log.LogInfo($"Loaded {NewCard.cards.Count} custom cards into data");
10050
}
10151

10252
private void SetSpecialAbilityIdentifiers()

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.13.1",
3+
"version_number": "1.13.2",
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)