Skip to content
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5bdb31a
Added Support for centralizing custom stats.
willuwontu Sep 1, 2021
2359c5d
Debugging push
willuwontu Sep 2, 2021
d5ce18b
Merge branch 'main' into CustomStatExtension
willuwontu Sep 7, 2021
c602fbe
Merge branch 'main' into CustomStatExtension
willuwontu Sep 7, 2021
3d7bf99
Add block to the base customcard, similar to gun and statmodifiers
willuwontu Sep 7, 2021
cfc35cf
Merge branch 'main' into CustomStatExtension
willuwontu Sep 26, 2021
fabd36a
Merge branch 'main' into CustomStatExtension
willuwontu Nov 21, 2021
4ac90ce
Merge branch 'main' into CustomStatExtension
willuwontu Dec 29, 2021
fc5555c
Merge branch 'main' into CustomStatExtension
willuwontu Jan 6, 2022
6db0389
Merge pull request #1 from Rounds-Modding/main
willuwontu Dec 14, 2022
5c559a7
Create CardChoicePatchGetSourceCard.cs
willuwontu Dec 14, 2022
be7d29b
Merge pull request #2 from Rounds-Modding/main
willuwontu Dec 15, 2022
5487621
Merge branch 'will-main' into CardChoicePatch
willuwontu Dec 15, 2022
11a9039
Merge pull request #3 from Rounds-Modding/main
willuwontu Dec 20, 2022
8fdfe59
Update CustomCard.cs
willuwontu Dec 20, 2022
7b15559
Update CustomCard.cs
willuwontu Dec 20, 2022
70428e6
Update Unbound.cs
willuwontu Dec 20, 2022
2c1abc0
Update CustomCard.cs
willuwontu Dec 20, 2022
df6d612
Update CustomCard.cs
willuwontu Dec 20, 2022
2268970
Update CustomCard.cs
willuwontu Dec 20, 2022
845f7fa
Update CustomCard.cs
willuwontu Dec 21, 2022
8dc3b8c
Merge remote-tracking branch 'upstream/main'
willuwontu Dec 21, 2022
feb77aa
Update UnboundLib.csproj
willuwontu Dec 21, 2022
0c24676
Update CustomCard.cs
willuwontu Dec 31, 2022
36a71c2
Update Unbound.cs
willuwontu Dec 31, 2022
eae72b6
Update CustomCard.cs
willuwontu Dec 31, 2022
f00f3df
Merge branch 'master' into CardChoicePatch
willuwontu Dec 31, 2022
5baeb2d
Revert "Merge branch 'master' into CardChoicePatch"
willuwontu Dec 31, 2022
521946f
Merge remote-tracking branch 'upstream/main' into CardChoicePatch
willuwontu Dec 31, 2022
aba530b
Update Unbound.cs
willuwontu Dec 31, 2022
10160e1
Merge remote-tracking branch 'upstream/main' into CardChoicePatch
willuwontu Jan 1, 2023
22f7545
Update CustomCard.cs
willuwontu Jan 2, 2023
3ee5997
Update CustomCard.cs
willuwontu Jan 2, 2023
115ec37
Update CustomCard.cs
willuwontu Jan 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions UnboundLib/Cards/CustomCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,21 @@ private void Awake()
{
cardInfo = gameObject.GetOrAddComponent<CardInfo>();
gun = gameObject.GetOrAddComponent<Gun>();
if (gun.objectsToSpawn == null)
{
gun.objectsToSpawn = new ObjectsToSpawn[0];
}
if (gun.projectiles == null)
{
gun.projectiles = new ProjectilesToSpawn[0];
}
cardStats = gameObject.GetOrAddComponent<ApplyCardStats>();
statModifiers = gameObject.GetOrAddComponent<CharacterStatModifiers>();
block = gameObject.GetOrAddComponent<Block>();
if (block.objectsToSpawn == null)
{
block.objectsToSpawn = new List<GameObject>();
}
SetupCard(cardInfo, gun, cardStats, statModifiers, block);
}

Expand Down Expand Up @@ -171,7 +183,8 @@ public static void BuildCard<T>(Action<CardInfo> callback) where T : CustomCard

public static void BuildUnityCard<T>(GameObject cardPrefab, Action<CardInfo> callback) where T : CustomCard
{
CardInfo cardInfo = cardPrefab.GetComponent<CardInfo>();
CardInfo cardInfo = cardPrefab.GetOrAddComponent<CardInfo>();
PhotonView view = cardPrefab.GetOrAddComponent<PhotonView>();
CustomCard customCard = cardPrefab.GetOrAddComponent<T>();

cardInfo.cardBase = customCard.GetCardBase();
Expand Down Expand Up @@ -201,7 +214,8 @@ public static void BuildUnityCard<T>(GameObject cardPrefab, Action<CardInfo> cal

public void BuildUnityCard(Action<CardInfo> callback)
{
CardInfo cardInfo = this.gameObject.GetComponent<CardInfo>();
CardInfo cardInfo = this.gameObject.GetOrAddComponent<CardInfo>();
PhotonView view = this.gameObject.GetOrAddComponent<PhotonView>();
CustomCard customCard = this;
GameObject cardPrefab = this.gameObject;

Expand Down