Skip to content

Commit a5391b9

Browse files
abilities on customcard fix
1 parent 1be6624 commit a5391b9

File tree

5 files changed

+16
-47
lines changed

5 files changed

+16
-47
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.12.0.0</Version>
7+
<Version>1.12.1.0</Version>
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
99
<LangVersion>9.0</LangVersion>
1010
</PropertyGroup>

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Changelog
2+
## v1.12.1
3+
- Bugfix so CustomCard doesn't wipe ability information.
4+
25
## v1.12
3-
- Fixes params
4-
- Adds feature for special abilities and special stat icons
5-
- Added support for emissions
6+
- Fixes params.
7+
- Adds feature for special abilities and special stat icons.
8+
- Added support for emissions.
69

710
## v1.11
811
- Added support for more identifiers

Models/CustomCard.cs

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class CustomCard
1616
public static Dictionary<int,TailIdentifier> tailIds = new();
1717

1818
public static Dictionary<string, Sprite> emissions = new();
19+
1920
public string name;
2021
public List<CardMetaCategory> metaCategories;
2122
public CardComplexity? cardComplexity;
@@ -32,8 +33,8 @@ public class CustomCard
3233
public SpecialStatIcon? specialStatIcon;
3334
public List<Tribe> tribes;
3435
public List<Trait> traits;
35-
public List<SpecialTriggeredAbility> specialAbilities = new();
36-
public List<Ability> abilities = new();
36+
public List<SpecialTriggeredAbility> specialAbilities;
37+
public List<Ability> abilities;
3738
public EvolveParams evolveParams;
3839
public string defaultEvolutionName;
3940
public TailParams tailParams;
@@ -48,10 +49,6 @@ public class CustomCard
4849
[IgnoreMapping] public Texture2D emissionTex;
4950
public GameObject animatedPortrait;
5051
public List<Texture> decals;
51-
public List<AbilityIdentifier> abilityIdList = new();
52-
public EvolveIdentifier evolveId;
53-
public IceCubeIdentifier iceCubeId;
54-
public TailIdentifier tailId;
5552

5653
public CustomCard(
5754
string name,
@@ -65,47 +62,16 @@ public CustomCard(
6562
CustomCard.cards.Add(this);
6663

6764
// Handle AbilityIdentifier
68-
List<AbilityIdentifier> abilitiesToRemove = new List<AbilityIdentifier>();
69-
if (abilityIdParam is not null)
65+
if (abilityIdParam is not null && abilityIdParam.Count > 0)
7066
{
71-
foreach (var id in abilityIdParam.Where(id => id.id != 0))
72-
{
73-
this.abilities.Add(id.id);
74-
abilitiesToRemove.Add(id);
75-
}
76-
77-
foreach (AbilityIdentifier id in abilitiesToRemove)
78-
{
79-
abilityIdParam.Remove(id);
80-
}
81-
82-
if (abilityIdParam.Count > 0)
83-
{
84-
CustomCard.abilityIds[CustomCard.cards.Count - 1] = abilityIdParam;
85-
}
67+
CustomCard.abilityIds[CustomCard.cards.Count - 1] = abilityIdParam;
8668
}
8769

88-
List<SpecialAbilityIdentifier> specialAbilitiesToRemove = new List<SpecialAbilityIdentifier>();
89-
if (specialAbilityIdParam is not null)
70+
if (specialAbilityIdParam is not null && specialAbilityIdParam.Count > 0)
9071
{
91-
foreach (var id in specialAbilityIdParam.Where(id => id.id != 0))
92-
{
93-
this.specialAbilities.Add(id.id);
94-
specialAbilitiesToRemove.Add(id);
95-
}
96-
97-
foreach (SpecialAbilityIdentifier id in specialAbilitiesToRemove)
98-
{
99-
specialAbilityIdParam.Remove(id);
100-
}
101-
102-
if (specialAbilityIdParam.Count > 0)
103-
{
104-
CustomCard.specialAbilityIds[CustomCard.cards.Count - 1] = specialAbilityIdParam;
105-
}
72+
CustomCard.specialAbilityIds[CustomCard.cards.Count - 1] = specialAbilityIdParam;
10673
}
10774

108-
10975
// Handle EvolveIdentifier
11076
if (evolveId is not null)
11177
{

Plugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class Plugin : BaseUnityPlugin
1414
{
1515
private const string PluginGuid = "cyantist.inscryption.api";
1616
private const string PluginName = "API";
17-
private const string PluginVersion = "1.12.0.0";
17+
private const string PluginVersion = "1.12.1.0";
1818

1919
internal static ManualLogSource Log;
2020
internal static ConfigEntry<bool> configEnergy;

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