@@ -13,18 +13,33 @@ public static class NewCard
1313 public static Dictionary < int , IceCubeIdentifier > iceCubeIds = new ( ) ;
1414 public static Dictionary < int , TailIdentifier > tailIds = new ( ) ;
1515
16- public static CardInfo CreateCard ( string name , string displayedName , int baseAttack , int baseHealth ,
16+ public static void Add ( CardInfo card , List < AbilityIdentifier > abilityIdsParam = null ,
17+ EvolveIdentifier evolveId = null , IceCubeIdentifier iceCubeId = null , TailIdentifier tailId = null
18+ )
19+ {
20+ NewCard . cards . Add ( card ) ;
21+ handleIdentifiers ( abilityIdsParam , evolveId , iceCubeId , tailId ) ;
22+ Plugin . Log . LogInfo ( $ "Loaded custom card { card . name } !") ;
23+ }
24+
25+
26+ // TODO Implement a handler for custom appearanceBehaviour - in particular custom card backs
27+ // TODO Change parameter order, and function setter call order to make more sense
28+ // TODO Rename parameters to be more user friendly
29+ public static void Add ( string name , string displayedName , int baseAttack , int baseHealth ,
1730 List < CardMetaCategory > metaCategories , CardComplexity cardComplexity , CardTemple temple ,
1831 string description = null , bool hideAttackAndHealth = false ,
1932 int bloodCost = 0 , int bonesCost = 0 , int energyCost = 0 ,
2033 List < GemType > gemsCost = null , SpecialStatIcon specialStatIcon = SpecialStatIcon . None ,
2134 List < Tribe > tribes = null , List < Trait > traits = null , List < SpecialTriggeredAbility > specialAbilities = null ,
22- List < Ability > abilities = null , EvolveParams evolveParams = null ,
35+ List < Ability > abilities = null , List < AbilityIdentifier > abilityIdsParam = null ,
36+ EvolveParams evolveParams = null ,
2337 string defaultEvolutionName = null , TailParams tailParams = null , IceCubeParams iceCubeParams = null ,
2438 bool flipPortraitForStrafe = false , bool onePerDeck = false ,
2539 List < CardAppearanceBehaviour . Appearance > appearanceBehaviour = null , Texture2D defaultTex = null ,
2640 Texture2D altTex = null , Texture titleGraphic = null , Texture2D pixelTex = null ,
27- GameObject animatedPortrait = null , List < Texture > decals = null )
41+ GameObject animatedPortrait = null , List < Texture > decals = null , EvolveIdentifier evolveId = null ,
42+ IceCubeIdentifier iceCubeId = null , TailIdentifier tailId = null )
2843 {
2944 CardInfo card = ScriptableObject . CreateInstance < CardInfo > ( ) ;
3045
@@ -119,50 +134,13 @@ public static CardInfo CreateCard(string name, string displayedName, int baseAtt
119134 card . titleGraphic = titleGraphic ;
120135 }
121136
122- return card ;
123- }
124-
125- public static void AddToPool ( CardInfo card , List < AbilityIdentifier > abilityIdsParam = null ,
126- EvolveIdentifier evolveId = null ,
127- IceCubeIdentifier iceCubeId = null , TailIdentifier tailId = null )
128- {
129- NewCard . cards . Add ( card ) ;
130- handleIdentifiers ( card , abilityIdsParam , evolveId , iceCubeId , tailId ) ;
131-
132- Plugin . Log . LogInfo ( $ "Loaded custom card { card . name } !") ;
133- }
134-
135- // TODO Implement a handler for custom appearanceBehaviour - in particular custom card backs
136- // TODO Change parameter order, and function setter call order to make more sense
137- // TODO Rename parameters to be more user friendly
138- public static void AddToPool ( string name , string displayedName , int baseAttack , int baseHealth ,
139- List < CardMetaCategory > metaCategories , CardComplexity cardComplexity , CardTemple temple ,
140- string description = null , bool hideAttackAndHealth = false ,
141- int bloodCost = 0 , int bonesCost = 0 , int energyCost = 0 ,
142- List < GemType > gemsCost = null , SpecialStatIcon specialStatIcon = SpecialStatIcon . None ,
143- List < Tribe > tribes = null , List < Trait > traits = null , List < SpecialTriggeredAbility > specialAbilities = null ,
144- List < Ability > abilities = null , List < AbilityIdentifier > abilityIdsParam = null ,
145- EvolveParams evolveParams = null ,
146- string defaultEvolutionName = null , TailParams tailParams = null , IceCubeParams iceCubeParams = null ,
147- bool flipPortraitForStrafe = false , bool onePerDeck = false ,
148- List < CardAppearanceBehaviour . Appearance > appearanceBehaviour = null , Texture2D defaultTex = null ,
149- Texture2D altTex = null , Texture titleGraphic = null , Texture2D pixelTex = null ,
150- GameObject animatedPortrait = null , List < Texture > decals = null , EvolveIdentifier evolveId = null ,
151- IceCubeIdentifier iceCubeId = null , TailIdentifier tailId = null )
152- {
153- var createdCard = CreateCard (
154- name , displayedName , baseAttack , baseHealth , metaCategories , cardComplexity , temple , description ,
155- hideAttackAndHealth , bloodCost , bonesCost , energyCost , gemsCost , specialStatIcon , tribes , traits ,
156- specialAbilities , abilities , evolveParams , defaultEvolutionName , tailParams , iceCubeParams ,
157- flipPortraitForStrafe , onePerDeck , appearanceBehaviour ,
158- defaultTex , altTex , titleGraphic , pixelTex , animatedPortrait , decals
159- ) ;
160-
161- NewCard . AddToPool ( createdCard , abilityIdsParam , evolveId , iceCubeId , tailId ) ;
137+ NewCard . Add ( card , abilityIdsParam , evolveId , iceCubeId , tailId ) ;
162138 }
163139
164- private static void handleIdentifiers ( CardInfo card , List < AbilityIdentifier > abilityIdsParam = null ,
165- EvolveIdentifier evolveId = null , IceCubeIdentifier iceCubeId = null , TailIdentifier tailId = null )
140+ private static void handleIdentifiers (
141+ List < AbilityIdentifier > abilityIdsParam = null , EvolveIdentifier evolveId = null ,
142+ IceCubeIdentifier iceCubeId = null , TailIdentifier tailId = null
143+ )
166144 {
167145 // Handle AbilityIdentifier
168146
@@ -218,9 +196,10 @@ private static void DetermineAndSetCardArt(
218196 pixelTex . name = newName ;
219197 pixelTex . filterMode = FilterMode . Point ;
220198
221- card . pixelPortrait = Sprite . Create ( pixelTex , CardUtils . DefaultCardPixelArtRect , CardUtils . DefaultVector2 ) ;
199+ card . pixelPortrait =
200+ Sprite . Create ( pixelTex , CardUtils . DefaultCardPixelArtRect , CardUtils . DefaultVector2 ) ;
222201 card . pixelPortrait . name = newName ;
223202 }
224203 }
225204 }
226- }
205+ }
0 commit comments