@@ -26,20 +26,21 @@ public static void Add(CardInfo card, List<AbilityIdentifier> abilityIdsParam =
2626 Plugin . Log . LogInfo ( $ "Loaded custom card { card . name } !") ;
2727 }
2828
29+
2930 // TODO Implement a handler for custom appearanceBehaviour - in particular custom card backs
3031 // TODO Change parameter order, and function setter call order to make more sense
3132 // TODO Rename parameters to be more user friendly
32- public static void Add ( string name , List < CardMetaCategory > metaCategories , CardComplexity cardComplexity ,
33- CardTemple temple , string displayedName , int baseAttack , int baseHealth ,
34- string description = null ,
35- bool hideAttackAndHealth = false , int cost = 0 , int bonesCost = 0 , int energyCost = 0 ,
33+ public static void Add ( string name , string displayedName , int baseAttack , int baseHealth ,
34+ List < CardMetaCategory > metaCategories , CardComplexity cardComplexity , CardTemple temple ,
35+ string description = null , bool hideAttackAndHealth = false ,
36+ int bloodCost = 0 , int bonesCost = 0 , int energyCost = 0 ,
3637 List < GemType > gemsCost = null , SpecialStatIcon specialStatIcon = SpecialStatIcon . None ,
3738 List < Tribe > tribes = null , List < Trait > traits = null , List < SpecialTriggeredAbility > specialAbilities = null ,
3839 List < Ability > abilities = null , List < AbilityIdentifier > abilityIdsParam = null ,
3940 List < SpecialAbilityIdentifier > specialAbilitiesIdsParam = null , EvolveParams evolveParams = null ,
4041 string defaultEvolutionName = null , TailParams tailParams = null , IceCubeParams iceCubeParams = null ,
4142 bool flipPortraitForStrafe = false , bool onePerDeck = false ,
42- List < CardAppearanceBehaviour . Appearance > appearanceBehaviour = null , Texture2D tex = null ,
43+ List < CardAppearanceBehaviour . Appearance > appearanceBehaviour = null , Texture2D defaultTex = null ,
4344 Texture2D altTex = null , Texture titleGraphic = null , Texture2D pixelTex = null ,
4445 GameObject animatedPortrait = null , List < Texture > decals = null , EvolveIdentifier evolveId = null ,
4546 IceCubeIdentifier iceCubeId = null , TailIdentifier tailId = null )
@@ -108,7 +109,7 @@ public static void Add(string name, List<CardMetaCategory> metaCategories, CardC
108109 }
109110
110111 // costs
111- card . cost = cost ;
112+ card . cost = bloodCost ;
112113 card . bonesCost = bonesCost ;
113114 card . energyCost = energyCost ;
114115
@@ -118,7 +119,7 @@ public static void Add(string name, List<CardMetaCategory> metaCategories, CardC
118119 }
119120
120121 // textures
121- DetermineAndSetCardArt ( name , card , tex , altTex , pixelTex ) ;
122+ DetermineAndSetCardArt ( name , card , defaultTex , altTex , pixelTex ) ;
122123
123124 if ( animatedPortrait is not null )
124125 {
@@ -152,16 +153,16 @@ private static void HandleIdentifiers(
152153 IceCubeIdentifier iceCubeId ,
153154 TailIdentifier tailId )
154155 {
155- // Handle AbilityIdentifier
156- List < AbilityIdentifier > toRemove = new List < AbilityIdentifier > ( ) ;
156+ List < AbilityIdentifier > abilitiesToRemove = new List < AbilityIdentifier > ( ) ;
157157 if ( abilityIdsParam is not null )
158158 {
159159 foreach ( var id in abilityIdsParam . Where ( id => id . id != 0 ) )
160160 {
161161 card . abilities . Add ( id . id ) ;
162+ abilitiesToRemove . Add ( id ) ;
162163 }
163164
164- foreach ( AbilityIdentifier id in toRemove )
165+ foreach ( AbilityIdentifier id in abilitiesToRemove )
165166 {
166167 abilityIdsParam . Remove ( id ) ;
167168 }
@@ -173,11 +174,18 @@ private static void HandleIdentifiers(
173174 }
174175
175176 // Handle SpecialAbilityIds
177+ List < SpecialAbilityIdentifier > specialAbilitiesToRemove = new List < AbilityIdentifier > ( ) ;
176178 if ( specialAbilitiesIdsParam is not null )
177179 {
178180 foreach ( var id in specialAbilitiesIdsParam . Where ( id => id . id != 0 ) )
179181 {
180182 card . specialAbilities . Add ( id . id ) ;
183+ specialAbilitiesToRemove . Add ( id ) ;
184+ }
185+
186+ foreach ( SpecialAbilityIdentifier id in specialAbilitiesToRemove )
187+ {
188+ specialAbilitiesIdsParam . Remove ( id ) ;
181189 }
182190
183191 if ( specialAbilitiesIdsParam . Count > 0 )
@@ -207,15 +215,15 @@ private static void HandleIdentifiers(
207215
208216 private static void DetermineAndSetCardArt (
209217 string name , CardInfo card ,
210- Texture2D tex , Texture2D altTex , Texture2D pixelTex )
218+ Texture2D defaultTex , Texture2D altTex , Texture2D pixelTex )
211219 {
212220 var newName = "portrait_" + name ;
213- if ( tex is not null )
221+ if ( defaultTex is not null )
214222 {
215- tex . name = newName ;
216- tex . filterMode = FilterMode . Point ;
223+ defaultTex . name = newName ;
224+ defaultTex . filterMode = FilterMode . Point ;
217225
218- card . portraitTex = Sprite . Create ( tex , CardUtils . DefaultCardArtRect , CardUtils . DefaultVector2 ) ;
226+ card . portraitTex = Sprite . Create ( defaultTex , CardUtils . DefaultCardArtRect , CardUtils . DefaultVector2 ) ;
219227 card . portraitTex . name = newName ;
220228 }
221229
0 commit comments