Skip to content

Commit 46cb74d

Browse files
authored
Merge pull request #24 from IngoHHacks/MergedPRs
Merged PRs
2 parents a5391b9 + 114d239 commit 46cb74d

39 files changed

+965
-483
lines changed

API.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<PropertyGroup>
43
<TargetFramework>netstandard2.0</TargetFramework>
54
<AssemblyName>API</AssemblyName>
65
<Description>An API for inscryption</Description>
7-
<Version>1.12.1.0</Version>
6+
<Version>1.13.0.0</Version>
87
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
98
<LangVersion>9.0</LangVersion>
9+
<DebugType>full</DebugType>
1010
</PropertyGroup>
1111

1212
<ItemGroup>

API.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31912.275
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "API", "API.csproj", "{DB27EC94-8D11-49F9-B2DB-F977B011F6CD}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{DB27EC94-8D11-49F9-B2DB-F977B011F6CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{DB27EC94-8D11-49F9-B2DB-F977B011F6CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{DB27EC94-8D11-49F9-B2DB-F977B011F6CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{DB27EC94-8D11-49F9-B2DB-F977B011F6CD}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {0414124C-4C03-4ED8-B606-E9EDE5608A85}
24+
EndGlobalSection
25+
EndGlobal

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Changelog
2+
## 1.13.0
3+
- Added support for custom card backgrounds, dialogs, encounters and talking cards
4+
- Fixes to abilities loading and stackable custom abilities
5+
26
## v1.12.1
37
- Bugfix so CustomCard doesn't wipe ability information.
48

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Collections.Generic;
2-
using System.Linq;
32
using DiskCardGame;
43
using UnityEngine;
54

@@ -94,15 +93,19 @@ public CustomCard(
9493
public CardInfo AdjustCard(CardInfo card)
9594
{
9695
TypeMapper<CustomCard, CardInfo>.Convert(this, card);
97-
96+
Plugin.Log.LogDebug($"Finished TypeMapping for card [{card.name}]!");
97+
98+
Plugin.Log.LogDebug($"Checking default tex is not null...");
9899
if (this.tex is not null)
99100
{
101+
Plugin.Log.LogDebug($"Default tex is not null, setting fields...");
100102
tex.name = "portrait_" + name;
101103
tex.filterMode = FilterMode.Point;
102104
card.portraitTex = Sprite.Create(tex, CardUtils.DefaultCardArtRect, CardUtils.DefaultVector2);
103105
card.portraitTex.name = "portrait_" + name;
104106
if (this.emissionTex is not null)
105107
{
108+
Plugin.Log.LogDebug($"Emission tex is not null, setting fields...");
106109
emissionTex.name = tex.name + "_emission";
107110
emissionTex.filterMode = FilterMode.Point;
108111
Sprite emissionSprite = Sprite.Create(emissionTex, CardUtils.DefaultCardArtRect, CardUtils.DefaultVector2);
@@ -111,23 +114,38 @@ public CardInfo AdjustCard(CardInfo card)
111114
}
112115
}
113116

117+
Plugin.Log.LogDebug($"Checking AltTex is not null...");
114118
if (this.altTex is not null)
115119
{
120+
Plugin.Log.LogDebug($"--> AltTex is not null, setting fields...");
116121
altTex.name = "portrait_" + name;
117122
altTex.filterMode = FilterMode.Point;
118123
card.alternatePortrait = Sprite.Create(altTex, CardUtils.DefaultCardArtRect, CardUtils.DefaultVector2);
119124
card.alternatePortrait.name = "portrait_" + name;
120125
}
121126

127+
Plugin.Log.LogDebug($"Checking pixelTex is not null...");
122128
if (this.pixelTex is not null)
123129
{
130+
Plugin.Log.LogDebug($"PixelTex is not null, setting fields...");
124131
pixelTex.name = "portrait_" + name;
125132
pixelTex.filterMode = FilterMode.Point;
126133
card.pixelPortrait =
127134
Sprite.Create(pixelTex, CardUtils.DefaultCardPixelArtRect, CardUtils.DefaultVector2);
128135
card.pixelPortrait.name = "portrait_" + name;
129136
}
130137

138+
Plugin.Log.LogDebug($"Checking decals is not null...");
139+
if (this.decals is not null)
140+
{
141+
foreach (var decal in this.decals)
142+
{
143+
decal.filterMode = FilterMode.Point;
144+
}
145+
146+
card.decals = this.decals;
147+
}
148+
131149
Plugin.Log.LogInfo($"Adjusted default card {name}!");
132150
return card;
133151
}

Models/Custom/CustomRegion.cs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using System.Collections.Generic;
2+
using DiskCardGame;
3+
using UnityEngine;
4+
5+
#pragma warning disable 169
6+
7+
namespace APIPlugin
8+
{
9+
public class CustomRegion
10+
{
11+
public static List<CustomRegion> regions = new List<CustomRegion>();
12+
13+
public string name;
14+
public int? tier;
15+
public List<CardInfo> terrainCards;
16+
public List<ConsumableItemData> consumableItems;
17+
public List<EncounterBlueprintData> encounters;
18+
public List<Opponent.Type> bosses;
19+
public List<CardInfo> likelyCards;
20+
public List<Tribe> dominantTribes;
21+
public PredefinedNodes predefinedNodes;
22+
public EncounterBlueprintData bossPrepEncounter;
23+
public StoryEventCondition bossPrepCondition;
24+
public List<ScarceSceneryEntry> scarceScenery;
25+
public List<FillerSceneryEntry> fillerScenery;
26+
public PredefinedScenery predefinedScenery;
27+
public string ambientLoopId;
28+
public bool? silenceCabinAmbience;
29+
public Color? boardLightColor;
30+
public Color? cardsLightColor;
31+
public bool? dustParticlesDisabled;
32+
public bool? fogEnabled;
33+
public VolumetricFogAndMist.VolumetricFogProfile fogProfile;
34+
public float? fogAlpha;
35+
public Texture mapAlbedo;
36+
public Texture mapEmission;
37+
public Color? mapEmissionColor;
38+
public List<GameObject> mapParticlesPrefabs;
39+
40+
public CustomRegion(string name)
41+
{
42+
this.name = name;
43+
CustomRegion.regions.Add(this);
44+
}
45+
46+
public RegionData AdjustRegion(RegionData region)
47+
{
48+
TypeMapper<CustomRegion, RegionData>.Convert(this, region);
49+
Plugin.Log.LogInfo($"Adjusted default region {name}!");
50+
return region;
51+
}
52+
53+
}
54+
}

Models/CustomRegion.cs

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Collections.Generic;
23
using DiskCardGame;
34

@@ -17,7 +18,13 @@ private AbilityIdentifier(string guid, string name)
1718
ids.Add(this);
1819
}
1920

21+
[Obsolete("Replaced by GetID")]
2022
public static AbilityIdentifier GetAbilityIdentifier(string guid, string name)
23+
{
24+
return GetID(guid, name);
25+
}
26+
27+
public static AbilityIdentifier GetID(string guid, string name)
2128
{
2229
return ids.Exists(x => x.guid == guid && x.name == name)
2330
? ids.Find(x => x.guid == guid && x.name == name)
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ namespace APIPlugin
44
{
55
public class EvolveIdentifier
66
{
7-
private string name;
8-
private int turnsToEvolve;
7+
private string name;
8+
private int turnsToEvolve;
99
private CardModificationInfo mods;
1010
private EvolveParams evolution;
11+
1112
public EvolveParams Evolution
1213
{
1314
get
@@ -26,6 +27,7 @@ public EvolveParams Evolution
2627
}
2728
}
2829
}
30+
2931
return this.evolution;
3032
}
3133
}
@@ -34,28 +36,28 @@ public EvolveIdentifier(string name, int turnsToEvolve, CardModificationInfo mod
3436
{
3537
this.name = name;
3638
this.turnsToEvolve = turnsToEvolve;
37-
this.mods = mods;
39+
this.mods = mods;
3840
}
3941

4042
private void SetParams(CardInfo card)
4143
{
42-
EvolveParams evolution = new EvolveParams();
44+
EvolveParams _evolution = new EvolveParams();
4345

44-
evolution.turnsToEvolve = this.turnsToEvolve;
46+
_evolution.turnsToEvolve = this.turnsToEvolve;
4547

46-
evolution.evolution = card;
48+
_evolution.evolution = card;
4749

4850
if (this.mods != null)
4951
{
50-
evolution.evolution.mods.Add(this.mods);
52+
_evolution.evolution.mods.Add(this.mods);
5153
}
5254

53-
this.evolution = evolution;
55+
this.evolution = _evolution;
5456
}
5557

5658
public override string ToString()
5759
{
5860
return name;
5961
}
6062
}
61-
}
63+
}
File renamed without changes.

0 commit comments

Comments
 (0)