-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathBaseConflict.Constants.Cards.pas
1196 lines (1050 loc) · 62.1 KB
/
BaseConflict.Constants.Cards.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
unit BaseConflict.Constants.Cards;
interface
uses
Generics.Collections,
SysUtils,
RegularExpressions,
Math,
StrUtils,
Engine.Math,
Engine.Script,
Engine.Log,
Engine.Helferlein,
Engine.Helferlein.Windows;
type
{$RTTI EXPLICIT METHODS([vcPublic, vcPublished]) PROPERTIES([vcPublic, vcPublished]) FIELDS([vcPrivate, vcProtected, vcPublic])}
DUnitUUID = string;
EnumCardType = (ctDrop, ctSpell, ctBuilding, ctSpawner);
SetCardType = set of EnumCardType;
EnumEntityColor = (ecColorless, ecBlack, ecGreen, ecRed, ecBlue, ecWhite);
SetEntityColor = set of EnumEntityColor;
SetTechLevels = set of byte;
EnumLeague = (leNone, leStone, leBronze, leSilver, leGold, leCrystal);
SetLeagues = set of byte;
EnumDamageType = (
dtSiege, dtTrue, dtIgnoreArmor,
dtRanged, dtMelee, dtSplash, dtSpell, dtAbility,
dtReflected, dtIrredirectable, dtRedirected, dtAntiAir, dtHoT, dtDoT, dtFlatHeal, dtOverheal,
dtCharge);
SetDamageType = set of EnumDamageType;
EnumArmorType = (atUnarmored, atLight, atMedium, atHeavy, atFortified);
const
// all non-special armor types aka the armor class chain
ARMORY_TYPES_NORMAL = [atUnarmored .. atHeavy];
type
{$RTTI EXPLICIT METHODS([vcPublic, vcPublished]) PROPERTIES([vcPublic, vcPublished]) FIELDS([vcPrivate, vcProtected, vcPublic])}
TTranslationVariable = class abstract
protected
FKey, FSpanClass : string;
public
constructor Create(const Key, SpanClass : string);
function Apply(const Text : string) : string; virtual;
end;
TTranslationStringVariable = class(TTranslationVariable)
protected
FValue : string;
public
constructor Create(const Key, SpanClass : string; Value : string);
function Apply(const Text : string) : string; override;
end;
TTranslationIntegerVariable = class(TTranslationVariable)
protected
FValue, FFractional : integer;
FIsPercentage : boolean;
public
constructor Create(const Key, SpanClass : string; Value, Fractional : integer; IsPercentage : boolean);
function Apply(const Text : string) : string; override;
end;
RAbilityDescription = record
public
Identifier, name, Hint : string;
constructor Create(const Identifier : string; Variables : TList<TTranslationVariable>);
end;
TCardDescription = class
public
IsFilled : boolean;
Identifier, name, ShortDescription, Description : string;
procedure Fill(const Identifier : string; Variables : TList<TTranslationVariable>);
end;
/// <summary> Contains info about a card. </summary>
TCardInfo = class
private
FUID, FBaseUID, FFilename, FSkinID : string;
FTechlevel : integer;
FCardType : EnumCardType;
FCardColors : SetEntityColor;
FLeague, FLevel : integer;
constructor Create(CardType : EnumCardType; Colors : SetEntityColor; Filename : string; Techlevel : integer);
function Clone(League, Level : integer) : TCardInfo;
public
property UID : string read FUID;
property BaseUID : string read FBaseUID;
property Filename : string read FFilename;
property SkinID : string read FSkinID;
property Techlevel : integer read FTechlevel;
property CardType : EnumCardType read FCardType;
[ScriptExcludeMember]
property CardColors : SetEntityColor read FCardColors;
property Level : integer read FLevel;
property League : integer read FLeague;
function HasSkin : boolean;
function SkinFileSuffix : string;
// type
function IsSpell : boolean;
function IsBuilding : boolean;
function IsSpawner : boolean;
function IsLegendary : boolean;
function IsEpic : boolean;
function IsDrop : boolean;
// cost
function GoldCost : integer;
function WoodCost : integer;
function MaxCost : integer;
function ChargeCount : integer;
function ChargeCooldown : integer;
// stats
function AttackDamage : single;
function AttackCooldown : integer;
function AttackRange : single;
function DPS : single;
function Health : single;
function Energy : integer;
function HasEnergy : boolean;
function EnergyCap : integer;
function SquadSize : integer;
function IsRanged : boolean;
function IsSiege : boolean;
function IsSupporter : boolean;
function DamageType : EnumDamageType;
function ArmorType : EnumArmorType;
function SkillList : string;
[ScriptExcludeMember]
function Skills : TArray<RAbilityDescription>;
function HasSkills : boolean;
function Keywords : TArray<string>;
function HasKeywords : boolean;
function AttackValue : integer;
function DefenseValue : integer;
function UtilityValue : integer;
// spell meta data
function SpellIsSingleTarget : boolean;
function SpellIsAreaTarget : boolean;
function SpellIsCharmTarget : boolean;
function SpellIsAllyTarget : boolean;
function SpellIsEnemyTarget : boolean;
function SpellHasTwoTargets : boolean;
// meta
function Name : string;
function ShortDescription : string;
function Description : string;
/// <summary> If the card is a spawner or drop, this is the spawned units filename otherwise its the cards filename. </summary>
function UnitFilename : string;
function SkinnedUnitFilename : string;
public
class function Compare(const Left, Right : TCardInfo) : integer;
end;
IHasCardInfo = interface
function GetID : integer;
function CardInfo : TCardInfo;
end;
EnumCardStringInfo = (ciName, ciShortDescription, ciDescription);
/// <summary> Helper methods for all card relevant actions. </summary>
TCardInfoManager = class
strict private
FServerUnitMapping : TObjectDictionary<string, TCardInfo>;
FCardInfoCache : TObjectDictionary<string, TObjectDictionary<RTuple<integer, integer>, TCardInfo>>;
private
procedure AddCard(const UID : string; CardInfo : TCardInfo; SkinID : string = '');
procedure AddSkin(const BaseUID, UID, SkinID : string);
public
constructor Create;
function GetAllCardUIDs : TArray<string>;
/// <summary> Resolves a card uid to its meta info. Result may be nil, if data is not present in client. </summary>
function ResolveCardUID(const CardUID : string; League, Level : integer) : TCardInfo;
function TryResolveCardUID(const CardUID : string; League, Level : integer; out CardInfo : TCardInfo) : boolean;
function ScriptFilenameToCardInfo(const ScriptFile, SkinID : string; League, Level : integer) : TCardInfo;
/// <summary> Resolves a script filename to the translated name of that unit. </summary>
function ScriptFilenameToCardStringInfo(const ScriptFile, SkinID : string; League : integer; InfoType : EnumCardStringInfo = ciName) : string;
/// <summary> Transforms a filename to the identifier of a unit, used by localization or to create the base unit of a drop or template. </summary>
function ScriptFilenameToCardIdentifier(const ScriptFile : string) : string;
function ScriptFilenameToCardColors(const ScriptFile : string) : SetEntityColor;
function ScriptFilenameToCardType(const ScriptFile : string) : EnumCardType;
function EntityColorsToFolder(const EntityColors : SetEntityColor) : string;
destructor Destroy; override;
end;
{$RTTI EXPLICIT METHODS([vcPublic, vcPublished]) PROPERTIES([vcPublic, vcPublished]) FIELDS([vcPrivate, vcProtected, vcPublic])}
const
ALL_COLORS : SetEntityColor = [low(EnumEntityColor) .. high(EnumEntityColor)];
ALL_TECHLEVELS : SetTechLevels = [1, 2, 3];
ALL_LEAGUES : SetLeagues = [1, 2, 3, 4, 5];
ALL_CARDTYPES : SetCardType = [low(EnumCardType) .. high(EnumCardType)];
MIN_LEAGUE = 1;
MAX_LEAGUE = 5;
MIN_LEVEL = 1;
MAX_LEVEL = 5;
DISABLE_LEAGUE_SYSTEM = False;
DEFAULT_LEAGUE = MAX_LEAGUE - 1;
DEFAULT_LEVEL = MAX_LEVEL;
FILE_EXTENSION_SPELL = '.sps';
FILE_IDENTIFIER_DROP = 'Drop';
FILE_IDENTIFIER_SPAWNER = 'Spawner';
FILE_IDENTIFIER_BUILDING = 'Building';
FILE_IDENTIFIER_GOLEMS = 'Golems';
FILE_IDENTIFIER_SPELL = 'Spell';
FILE_EXTENSION_ENTITY = '.ets';
SKIN_GROUP_DEFAULT = 'default';
SKIN_GROUP_CRUSADER = 'crusader';
SKIN_GROUP_MACHINE = 'machine';
SKIN_GROUP_RAINBOW = 'rainbow';
SKIN_GROUP_SNOW = 'snow';
SKIN_GROUP_UNDERWORLD = 'underworld';
SKIN_GROUP_WOODLANDS = 'woodlands';
SKIN_GROUP_WIP = 'wip';
SKIN_GROUP_PUR = 'pur';
SKIN_GROUP_SCILL = 'scill';
SKIN_GROUP_TOURNAMENT = 'tournament';
SKIN_GROUP_SPRING = 'spring';
SKIN_GROUP_SUMMER = 'summer';
SKIN_GROUP_STEAM = 'steam';
SKIN_GROUP_ROFL = 'rofl';
SKIN_GROUP_INFLAMED = 'inflamed';
SKIN_GROUP_POPULAR = 'popular';
var
CardInfoManager : TCardInfoManager;
implementation
uses
BaseConflict.Constants,
BaseConflict.Globals,
BaseConflict.Classes.Shared;
{ TCardInfoManager }
function TCardInfoManager.ScriptFilenameToCardColors(const ScriptFile : string) : SetEntityColor;
var
lowerScriptFile : string;
begin
lowerScriptFile := ScriptFile.ToLowerInvariant;
if lowerScriptFile.Contains('green\') then Result := [ecGreen]
else if lowerScriptFile.Contains('white\') then Result := [ecWhite]
else if lowerScriptFile.Contains('black\') then Result := [ecBlack]
else if lowerScriptFile.Contains('red\') then Result := [ecRed]
else if lowerScriptFile.Contains('blue\') then Result := [ecBlue]
else if lowerScriptFile.Contains('colorless\') or lowerScriptFile.Contains('golems\') or lowerScriptFile.Contains('neutral\') or lowerScriptFile.Contains('scenario\') then Result := [ecColorless]
else if lowerScriptFile.Contains('greenwhite\') then Result := [ecGreen, ecWhite]
else if lowerScriptFile.Contains('blackwhite\') then Result := [ecBlack, ecWhite]
else if lowerScriptFile.Contains('blackgreen\') then Result := [ecBlack, ecGreen]
else Result := [];
end;
function TCardInfoManager.ScriptFilenameToCardIdentifier(const ScriptFile : string) : string;
begin
Result := ExtractFileName(ScriptFile);
Result := ChangeFileExt(Result, '');
Result := HString.Replace(Result, [FILE_IDENTIFIER_DROP, FILE_IDENTIFIER_SPAWNER, FILE_IDENTIFIER_BUILDING, FILE_IDENTIFIER_SPELL])
end;
function TCardInfoManager.ScriptFilenameToCardInfo(const ScriptFile, SkinID : string; League, Level : integer) : TCardInfo;
var
CardInfo : TCardInfo;
begin
Result := nil;
for CardInfo in FServerUnitMapping.Values do
if SameText(CardInfo.Filename, ScriptFile) and SameText(CardInfo.SkinID, SkinID) then
exit(ResolveCardUID(CardInfo.UID, League, Level));
end;
function TCardInfoManager.ScriptFilenameToCardStringInfo(const ScriptFile, SkinID : string; League : integer; InfoType : EnumCardStringInfo) : string;
var
LangKey, LangKeyPrefix, TypeKey, SkinKey : string;
CardType : EnumCardType;
begin
LangKeyPrefix := '';
case InfoType of
ciName : LangKeyPrefix := 'card_name_';
ciShortDescription : LangKeyPrefix := 'card_short_description_';
ciDescription : LangKeyPrefix := 'card_description_';
end;
CardType := ScriptFilenameToCardType(ScriptFile);
case CardType of
ctDrop : TypeKey := '_drop';
ctSpell : TypeKey := '';
ctBuilding : TypeKey := '';
ctSpawner : TypeKey := '_spawner';
else TypeKey := '';
end;
if SkinID <> '' then
SkinKey := '_' + SkinID
else
SkinKey := '';
LangKey := '§' + LangKeyPrefix + ScriptFilenameToCardIdentifier(ScriptFile).Replace(FILE_IDENTIFIER_GOLEMS, '') + SkinKey;
// first try entity with league and card type
if not _(LangKey + TypeKey + '_' + Inttostr(League), Result) and
not _(LangKey + TypeKey, Result) and
not _(LangKey + '_' + Inttostr(League), Result) and
not _(LangKey, Result) then
begin
// then try same without suffixes
LangKey := '§' + LangKeyPrefix + ScriptFilenameToCardIdentifier(TRegex.SubstituteDirect(ScriptFile, '(_\w+)', ''));
if not _(LangKey + TypeKey + '_' + Inttostr(League), Result) and
not _(LangKey + TypeKey, Result) and
not _(LangKey + '_' + Inttostr(League), Result) then
Result := _(LangKey);
end;
end;
function TCardInfoManager.ScriptFilenameToCardType(const ScriptFile : string) : EnumCardType;
begin
if ContainsText(ScriptFile, FILE_IDENTIFIER_SPAWNER) then Result := ctSpawner
else if ContainsText(ScriptFile, FILE_IDENTIFIER_BUILDING) then Result := ctBuilding
else if ContainsText(ScriptFile, FILE_EXTENSION_SPELL) or ContainsText(ScriptFile, FILE_IDENTIFIER_SPELL) then Result := ctSpell
else Result := ctDrop;
end;
procedure TCardInfoManager.AddCard(const UID : string; CardInfo : TCardInfo; SkinID : string);
begin
CardInfo.FUID := UID;
// unskinned cards have themselves as base
if CardInfo.BaseUID = '' then
CardInfo.FBaseUID := CardInfo.UID;
CardInfo.FSkinID := SkinID;
FServerUnitMapping.Add(UID, CardInfo);
end;
procedure TCardInfoManager.AddSkin(const BaseUID, UID, SkinID : string);
var
CardInfo : TCardInfo;
begin
CardInfo := FServerUnitMapping[BaseUID];
// if first skin is added to a card its default entry is the default skin
if not CardInfo.HasSkin then
CardInfo.FSkinID := SKIN_GROUP_DEFAULT;
CardInfo := CardInfo.Clone(MAX_LEAGUE, MAX_LEVEL);
CardInfo.FBaseUID := BaseUID;
AddCard(UID, CardInfo, SkinID);
end;
constructor TCardInfoManager.Create;
begin
FServerUnitMapping := TObjectDictionary<string, TCardInfo>.Create([doOwnsValues]);
FCardInfoCache := TObjectDictionary < string, TObjectDictionary < RTuple<integer, integer>, TCardInfo >>.Create([doOwnsValues]);
end;
destructor TCardInfoManager.Destroy;
begin
FServerUnitMapping.Free;
FCardInfoCache.Free;
inherited;
end;
function TCardInfoManager.EntityColorsToFolder(const EntityColors : SetEntityColor) : string;
begin
Result := '';
if ecBlack in EntityColors then Result := Result + 'Black';
if ecBlue in EntityColors then Result := Result + 'Blue';
if ecColorless in EntityColors then Result := Result + 'Colorless';
if ecGreen in EntityColors then Result := Result + 'Green';
if ecRed in EntityColors then Result := Result + 'Red';
if ecWhite in EntityColors then Result := Result + 'White';
Result := Result + '\';
end;
function TCardInfoManager.GetAllCardUIDs : TArray<string>;
begin
Result := FServerUnitMapping.Keys.ToArray;
end;
function TCardInfoManager.ResolveCardUID(const CardUID : string; League, Level : integer) : TCardInfo;
begin
if DISABLE_LEAGUE_SYSTEM then
begin
League := DEFAULT_LEAGUE;
Level := DEFAULT_LEVEL;
end;
// replace is hack for dui
if not TryResolveCardUID(CardUID.Replace('_', '-'), League, Level, Result) then Result := nil;
end;
function TCardInfoManager.TryResolveCardUID(const CardUID : string; League, Level : integer; out CardInfo : TCardInfo) : boolean;
var
CardInfos : TObjectDictionary<RTuple<integer, integer>, TCardInfo>;
Res : TCardInfo;
begin
if DISABLE_LEAGUE_SYSTEM then
begin
League := DEFAULT_LEAGUE;
Level := DEFAULT_LEVEL;
end;
if not FCardInfoCache.TryGetValue(CardUID, CardInfos) then
begin
CardInfos := TObjectDictionary<RTuple<integer, integer>, TCardInfo>.Create([doOwnsValues]);
FCardInfoCache.Add(CardUID, CardInfos);
end;
if not CardInfos.TryGetValue(RTuple<integer, integer>.Create(League, Level), Res) then
begin
if FServerUnitMapping.TryGetValue(CardUID, Res) then
begin
Res := Res.Clone(League, Level);
CardInfos.Add(RTuple<integer, integer>.Create(League, Level), Res);
end
else
begin
HLog.Write(elWarning, 'TCardInfoManager.ResolveCardUID: Card "%s" is not present in client!', [CardUID]);
exit(False);
end;
end;
CardInfo := Res;
Result := True;
end;
{ TCardInfo }
function TCardInfo.ArmorType : EnumArmorType;
begin
Result := EntityDataCache.Read(UnitFilename, League, Level, eiArmorType, []).AsEnumType<EnumArmorType>;
end;
function TCardInfo.AttackCooldown : integer;
begin
Result := EntityDataCache.Read(UnitFilename, League, Level, eiCooldown, [GROUP_MAINWEAPON]).AsInteger;
end;
function TCardInfo.AttackDamage : single;
begin
Result := EntityDataCache.Read(UnitFilename, League, Level, eiWelaDamage, [GROUP_MAINWEAPON]).AsSingle;
end;
function TCardInfo.AttackRange : single;
begin
Result := EntityDataCache.Read(UnitFilename, League, Level, eiWelaRange, [GROUP_MAINWEAPON]).AsSingle;
end;
function TCardInfo.AttackValue : integer;
begin
Result := EntityDataCache.Read(UnitFilename, League, Level, eiCardStats, [], ord(reMetaAttack)).AsInteger;
end;
function TCardInfo.ChargeCooldown : integer;
begin
if IsSpell then
begin
Result := EntityDataCache.Read(Filename, League, Level, eiCooldown, [1]).AsInteger;
end
else
Result := EntityDataCache.Read(Filename, League, Level, eiCooldown, []).AsInteger;
end;
function TCardInfo.ChargeCount : integer;
begin
Result := EntityDataCache.Read(Filename, League, Level, eiResourceCap, [], ord(reCharge)).AsInteger;
end;
function TCardInfo.Clone(League, Level : integer) : TCardInfo;
begin
Result := TCardInfo.Create(
self.CardType,
self.CardColors,
self.Filename,
self.Techlevel);
Result.FLeague := League;
Result.FLevel := Level;
Result.FUID := self.UID;
Result.FBaseUID := self.BaseUID;
Result.FSkinID := self.SkinID;
end;
class function TCardInfo.Compare(const Left, Right : TCardInfo) : integer;
var
Inverse : boolean;
L, R : TCardInfo;
begin
Result := 0;
L := Left;
R := Right;
if not assigned(R) and not assigned(L) then exit;
Inverse := assigned(R) and not assigned(L);
if Inverse then HGeneric.Swap<TCardInfo>(L, R);
if assigned(L) then
begin
if not assigned(R) then
begin
if L.IsSpawner then Result := 1
else Result := -1;
end
else
begin
// split for spawners
if L.IsSpawner and not R.IsSpawner then Result := 1
else if not L.IsSpawner and R.IsSpawner then Result := -1
// split for techlevel
else if L.Techlevel <> R.Techlevel then Result := L.Techlevel - R.Techlevel
// split for spells
else if L.IsSpell and not R.IsSpell then Result := 1
else if not L.IsSpell and R.IsSpell then Result := -1
// split for buildings
else if L.IsBuilding and not R.IsBuilding then Result := 1
else if not L.IsBuilding and R.IsBuilding then Result := -1
// order groups by filename
else if L.Filename <> R.Filename then Result := CompareText(L.Filename, R.Filename)
// order by league
else if L.League <> R.League then Result := L.League - R.League
else Result := L.Level - R.Level;
end;
end;
if Inverse then Result := -Result;
end;
constructor TCardInfo.Create(CardType : EnumCardType; Colors : SetEntityColor; Filename : string; Techlevel : integer);
begin
FLeague := MAX_LEAGUE;
FLevel := MAX_LEVEL;
FCardType := CardType;
FCardColors := Colors;
FFilename := Filename;
FTechlevel := Techlevel;
end;
function TCardInfo.DamageType : EnumDamageType;
begin
if IsSiege then Result := dtSiege
else if IsRanged then Result := dtRanged
else Result := dtMelee;
end;
function TCardInfo.DefenseValue : integer;
begin
Result := EntityDataCache.Read(UnitFilename, League, Level, eiCardStats, [], ord(reMetaDefense)).AsInteger;
end;
function TCardInfo.DPS : single;
begin
Result := EntityDataCache.Read(UnitFilename, League, Level, eiCooldown, [GROUP_MAINWEAPON]).AsInteger;
if Result <= 0 then Result := 0
else Result := EntityDataCache.Read(UnitFilename, League, Level, eiWelaDamage, [GROUP_MAINWEAPON]).AsSingle / (Result / 1000.0);
end;
function TCardInfo.Energy : integer;
begin
Result := EntityDataCache.Read(UnitFilename, League, Level, eiResourceBalance, [], ord(reMana)).AsInteger;
end;
function TCardInfo.EnergyCap : integer;
begin
Result := EntityDataCache.Read(UnitFilename, League, Level, eiResourceCap, [], ord(reMana)).AsInteger;
end;
function TCardInfo.GoldCost : integer;
begin
Result := round(EntityDataCache.Read(Filename, League, Level, eiResourceCost, [], ord(reGold)).AsSingle);
end;
function TCardInfo.HasEnergy : boolean;
begin
Result := EnergyCap > 0;
end;
function TCardInfo.HasKeywords : boolean;
begin
Result := length(Keywords) > 0;
end;
function TCardInfo.HasSkills : boolean;
begin
Result := length(Skills) > 0;
end;
function TCardInfo.HasSkin : boolean;
begin
Result := SkinID <> '';
end;
function TCardInfo.Health : single;
begin
Result := EntityDataCache.Read(UnitFilename, League, Level, eiResourceCap, [], ord(reHealth)).AsSingle;
end;
function TCardInfo.IsBuilding : boolean;
begin
Result := CardType = ctBuilding;
end;
function TCardInfo.IsDrop : boolean;
begin
Result := CardType = ctDrop;
end;
function TCardInfo.IsEpic : boolean;
begin
Result := upEpic in EntityDataCache.Read(UnitFilename, League, Level, eiUnitProperties, []).AsSetType<SetUnitProperty>;
end;
function TCardInfo.IsLegendary : boolean;
begin
Result := upLegendary in EntityDataCache.Read(UnitFilename, League, Level, eiUnitProperties, []).AsSetType<SetUnitProperty>;
end;
function TCardInfo.IsRanged : boolean;
begin
Result := dtRanged in EntityDataCache.Read(UnitFilename, League, Level, eiDamageType, [GROUP_MAINWEAPON]).AsType<SetDamageType>;
end;
function TCardInfo.IsSiege : boolean;
begin
Result := dtSiege in EntityDataCache.Read(UnitFilename, League, Level, eiDamageType, [GROUP_MAINWEAPON]).AsType<SetDamageType>;
end;
function TCardInfo.IsSpawner : boolean;
begin
Result := CardType = ctSpawner;
end;
function TCardInfo.IsSpell : boolean;
begin
Result := CardType = ctSpell;
end;
function TCardInfo.IsSupporter : boolean;
begin
Result := upSupporter in EntityDataCache.Read(UnitFilename, League, Level, eiUnitProperties, []).AsSetType<SetUnitProperty>;
end;
function TCardInfo.MaxCost : integer;
begin
Result := round(Max(EntityDataCache.Read(Filename, League, Level, eiResourceCost, [], ord(reGold)).AsSingle, EntityDataCache.Read(Filename, League, Level, eiResourceCost, [], ord(reWood)).AsSingle));
end;
function TCardInfo.Name : string;
begin
Result := CardInfoManager.ScriptFilenameToCardStringInfo(Filename, SkinID, League, ciName);
end;
function TCardInfo.ShortDescription : string;
var
CardDescription : TCardDescription;
begin
Result := '';
CardDescription := TCardDescription.Create;
EntityDataCache.Trigger(Filename, League, Level, eiBuildAbilityList, [nil, nil, CardDescription]);
if CardDescription.IsFilled then
Result := CardDescription.ShortDescription
else
Result := CardInfoManager.ScriptFilenameToCardStringInfo(Filename, SkinID, League, ciShortDescription);
CardDescription.Free;
end;
function TCardInfo.Description : string;
var
CardDescription : TCardDescription;
begin
Result := '';
CardDescription := TCardDescription.Create;
EntityDataCache.Trigger(Filename, League, Level, eiBuildAbilityList, [nil, nil, CardDescription]);
if CardDescription.IsFilled then
Result := CardDescription.Description
else
Result := CardInfoManager.ScriptFilenameToCardStringInfo(Filename, SkinID, League, ciDescription);
CardDescription.Free;
end;
function TCardInfo.SkillList : string;
var
Abilities : TList<RAbilityDescription>;
List : TList<string>;
i : integer;
begin
Result := '';
Abilities := TList<RAbilityDescription>.Create;
List := TList<string>.Create;
EntityDataCache.Trigger(UnitFilename, League, Level, eiBuildAbilityList, [Abilities, nil, nil]);
for i := 0 to Abilities.Count - 1 do
List.Add(Abilities[i].Name);
Result := HString.Join(List.ToArray, ', ');
Abilities.Free;
List.Free;
end;
function TCardInfo.Skills : TArray<RAbilityDescription>;
var
SkillList : TList<RAbilityDescription>;
begin
SkillList := TList<RAbilityDescription>.Create;
EntityDataCache.Trigger(UnitFilename, League, Level, eiBuildAbilityList, [SkillList, nil, nil]);
Result := SkillList.ToArray;
SkillList.Free;
end;
function TCardInfo.SkinFileSuffix : string;
begin
if HasSkin then
Result := '_' + SkinID
else
Result := '';
end;
function TCardInfo.SkinnedUnitFilename : string;
begin
if UnitFilename.Contains('.') then
Result := UnitFilename.Replace('.', SkinFileSuffix + '.')
else
Result := UnitFilename + SkinFileSuffix;
end;
function TCardInfo.SpellHasTwoTargets : boolean;
begin
Result := upSpellDoubleArea in EntityDataCache.Read(UnitFilename, League, Level, eiUnitProperties, []).AsSetType<SetUnitProperty>;
end;
function TCardInfo.SpellIsAllyTarget : boolean;
begin
Result := upSpellAlly in EntityDataCache.Read(UnitFilename, League, Level, eiUnitProperties, []).AsSetType<SetUnitProperty>;
end;
function TCardInfo.SpellIsAreaTarget : boolean;
begin
Result := upSpellArea in EntityDataCache.Read(UnitFilename, League, Level, eiUnitProperties, []).AsSetType<SetUnitProperty>;
end;
function TCardInfo.SpellIsCharmTarget : boolean;
begin
Result := upSpellCharm in EntityDataCache.Read(UnitFilename, League, Level, eiUnitProperties, []).AsSetType<SetUnitProperty>;
end;
function TCardInfo.SpellIsEnemyTarget : boolean;
begin
Result := upSpellEnemy in EntityDataCache.Read(UnitFilename, League, Level, eiUnitProperties, []).AsSetType<SetUnitProperty>;
end;
function TCardInfo.SpellIsSingleTarget : boolean;
begin
Result := upSpellSingle in EntityDataCache.Read(UnitFilename, League, Level, eiUnitProperties, []).AsSetType<SetUnitProperty>;
end;
function TCardInfo.Keywords : TArray<string>;
var
KeywordList : TList<string>;
begin
KeywordList := TList<string>.Create;
EntityDataCache.Trigger(UnitFilename, League, Level, eiBuildAbilityList, [nil, KeywordList, nil]);
Result := KeywordList.ToArray;
KeywordList.Free;
end;
function TCardInfo.SquadSize : integer;
begin
Result := EntityDataCache.Read(Filename, League, Level, eiWelaCount, [GROUP_DROP_SPAWNER]).AsIntegerDefault(1);
end;
function TCardInfo.UnitFilename : string;
begin
if CardType in [ctDrop, ctSpawner, ctBuilding] then Result := ExtractFilePath(Filename) + CardInfoManager.ScriptFilenameToCardIdentifier(Filename)
else Result := Filename;
end;
function TCardInfo.UtilityValue : integer;
begin
Result := EntityDataCache.Read(UnitFilename, League, Level, eiCardStats, [], ord(reMetaUtility)).AsInteger;
end;
function TCardInfo.WoodCost : integer;
begin
Result := round(EntityDataCache.Read(Filename, League, Level, eiResourceCost, [], ord(reWood)).AsSingle);
end;
{ TTranslationVariable }
function TTranslationVariable.Apply(const Text : string) : string;
begin
Result := Text;
end;
constructor TTranslationVariable.Create(const Key, SpanClass : string);
begin
FKey := Key;
FSpanClass := SpanClass;
end;
{ TTranslationIntegerVariable }
function TTranslationIntegerVariable.Apply(const Text : string) : string;
var
ValueText : string;
begin
Result := inherited Apply(Text);
ValueText := Inttostr(FValue);
if FFractional <> 0 then
ValueText := ValueText + HInternationalizer.DecimalSeparator + Inttostr(FFractional);
if FIsPercentage then
ValueText := HInternationalizer.MakePercentage(ValueText);
if FSpanClass <> '' then
ValueText := '<span class="keyword ' + FSpanClass + '">' + ValueText + '</span>';
Result := Result.Replace('%(' + FKey + ')', ValueText);
end;
constructor TTranslationIntegerVariable.Create(const Key, SpanClass : string; Value, Fractional : integer; IsPercentage : boolean);
begin
inherited Create(Key, SpanClass);
FValue := Value;
FFractional := Fractional;
FIsPercentage := IsPercentage;
end;
{ RAbilityDescription }
constructor RAbilityDescription.Create(const Identifier : string; Variables : TList<TTranslationVariable>);
var
i : integer;
begin
self.Identifier := Identifier;
self.Name := HInternationalizer.TranslateTextRecursive('§unitability_name_' + Identifier).Replace(' ', #160);
self.Hint := HInternationalizer.TranslateTextRecursive('§unitability_hint_' + Identifier);
for i := 0 to Variables.Count - 1 do
begin
self.Name := Variables[i].Apply(self.Name);
self.Hint := Variables[i].Apply(self.Hint);
end;
end;
{ TTranslationStringVariable }
function TTranslationStringVariable.Apply(const Text : string) : string;
var
ValueText : string;
begin
Result := inherited Apply(Text);
ValueText := FValue;
if FSpanClass <> '' then
ValueText := '<span class="keyword ' + FSpanClass + '">' + ValueText + '</span>';
Result := Result.Replace('%(' + FKey + ')', ValueText);
end;
constructor TTranslationStringVariable.Create(const Key, SpanClass : string; Value : string);
begin
inherited Create(Key, SpanClass);
FValue := Value;
end;
{ TCardDescription }
procedure TCardDescription.Fill(const Identifier : string; Variables : TList<TTranslationVariable>);
var
i : integer;
begin
IsFilled := True;
self.Identifier := Identifier;
self.Name := HInternationalizer.TranslateTextRecursive('§card_name_' + Identifier);
self.ShortDescription := HInternationalizer.TranslateTextRecursive('§card_short_description_' + Identifier);
self.Description := HInternationalizer.TranslateTextRecursive('§card_description_' + Identifier);
for i := 0 to Variables.Count - 1 do
begin
self.ShortDescription := Variables[i].Apply(self.ShortDescription);
self.Description := Variables[i].Apply(self.Description);
end;
end;
initialization
CardInfoManager := TCardInfoManager.Create;
/// /// White /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// spawner
CardInfoManager.AddCard('30b4f36d-03d4-413c-8e9c-dc9f70346c15', TCardInfo.Create(ctSpawner, [ecWhite], 'Units\White\ArcherSpawner', 1));
CardInfoManager.AddSkin('30b4f36d-03d4-413c-8e9c-dc9f70346c15', '417f384a-7eb4-49d2-ad88-5b3904a01398', SKIN_GROUP_ROFL);
CardInfoManager.AddSkin('30b4f36d-03d4-413c-8e9c-dc9f70346c15', '48ae7ebe-0e3a-4955-80a8-29316e20e936', SKIN_GROUP_INFLAMED);
CardInfoManager.AddCard('0fc18397-7dfc-4df8-938c-940e5dbb34f0', TCardInfo.Create(ctSpawner, [ecWhite], 'Units\White\AvengerSpawner', 3));
CardInfoManager.AddCard('19439e1a-aec8-4a83-909b-cd8741d81271', TCardInfo.Create(ctSpawner, [ecWhite], 'Units\White\BallistaSpawner', 1));
CardInfoManager.AddCard('8b1471e4-a394-4d11-836c-06e9187135a7', TCardInfo.Create(ctSpawner, [ecWhite], 'Units\White\DefenderSpawner', 3));
CardInfoManager.AddCard('212b4d7e-65f9-43fa-a3df-50b31dd3da8f', TCardInfo.Create(ctSpawner, [ecWhite], 'Units\White\FootmanSpawner', 1));
CardInfoManager.AddSkin('212b4d7e-65f9-43fa-a3df-50b31dd3da8f', '21f58162-fc78-4acf-8a95-0735ec45f078', SKIN_GROUP_MACHINE);
CardInfoManager.AddSkin('212b4d7e-65f9-43fa-a3df-50b31dd3da8f', '6e2f39cd-82a3-4c94-9f90-5e17a65ed2c5', SKIN_GROUP_UNDERWORLD);
CardInfoManager.AddSkin('212b4d7e-65f9-43fa-a3df-50b31dd3da8f', 'c42dc08a-fa5c-4fa3-8f61-cc1a132804c3', SKIN_GROUP_WOODLANDS);
CardInfoManager.AddCard('11fbcd20-31d6-43d7-aba0-528163cdcb3d', TCardInfo.Create(ctSpawner, [ecWhite], 'Units\White\HeavyGunnerSpawner', 2));
CardInfoManager.AddCard('43d78d4c-793e-4023-9c89-8caf1942b0d6', TCardInfo.Create(ctSpawner, [ecWhite], 'Units\White\MarksmanSpawner', 2));
CardInfoManager.AddSkin('43d78d4c-793e-4023-9c89-8caf1942b0d6', 'abfd1ecc-bab3-49f3-9a98-e454ad0fbd27', SKIN_GROUP_WOODLANDS);
CardInfoManager.AddCard('cfd5b8a3-b414-423f-9fd4-6414cfb8ca67', TCardInfo.Create(ctSpawner, [ecWhite], 'Units\White\PriestSpawner', 1));
CardInfoManager.AddSkin('cfd5b8a3-b414-423f-9fd4-6414cfb8ca67', '557ebd10-cdbe-4a1b-801b-67ee65d56822', SKIN_GROUP_WIP);
CardInfoManager.AddCard('0fb667e6-5c8b-4488-85ba-d932dbff8148', TCardInfo.Create(ctSpawner, [ecWhite], 'Units\White\MonkSpawner', 1));
CardInfoManager.AddSkin('0fb667e6-5c8b-4488-85ba-d932dbff8148', '5a1b91b8-41b4-4913-8a67-c9543272c6ad', SKIN_GROUP_UNDERWORLD);
// drops
CardInfoManager.AddCard('51c25adb-3f4b-4e89-a972-15c2080933b9', TCardInfo.Create(ctDrop, [ecWhite], 'Units\White\ArcherDrop', 1));
CardInfoManager.AddSkin('51c25adb-3f4b-4e89-a972-15c2080933b9', '2d74b457-5029-4fec-8b92-9b5945ba48ee', SKIN_GROUP_ROFL);
CardInfoManager.AddSkin('51c25adb-3f4b-4e89-a972-15c2080933b9', '4bb5dc05-4f82-453c-be15-8a2391a85581', SKIN_GROUP_INFLAMED);
CardInfoManager.AddCard('ad3f1e1f-8c32-444e-acdc-9e01416890a1', TCardInfo.Create(ctDrop, [ecWhite], 'Units\White\AvengerDrop', 3));
CardInfoManager.AddCard('d6775352-3586-4a2d-af0f-b3149d59dbec', TCardInfo.Create(ctDrop, [ecWhite], 'Units\White\BallistaDrop', 1));
CardInfoManager.AddCard('21780eb8-3d2c-4c97-b279-59971475f3f8', TCardInfo.Create(ctDrop, [ecWhite], 'Units\White\DefenderDrop', 3));
CardInfoManager.AddSkin('21780eb8-3d2c-4c97-b279-59971475f3f8', 'c5b74530-c1ee-45e0-8799-930d21585689', SKIN_GROUP_POPULAR);
CardInfoManager.AddCard('4a3d81c7-8c6b-454d-9469-95f6cf394c9b', TCardInfo.Create(ctDrop, [ecWhite], 'Units\White\FootmanDrop', 1));
CardInfoManager.AddSkin('4a3d81c7-8c6b-454d-9469-95f6cf394c9b', 'e83c321e-b0f7-4531-a1a7-0aa0b3f838fb', SKIN_GROUP_MACHINE);
CardInfoManager.AddSkin('4a3d81c7-8c6b-454d-9469-95f6cf394c9b', '62ef3759-94df-4511-bcb1-663f5b0088b7', SKIN_GROUP_UNDERWORLD);
CardInfoManager.AddSkin('4a3d81c7-8c6b-454d-9469-95f6cf394c9b', 'ffe7ab82-78f0-4e5f-b206-17483aa7bf13', SKIN_GROUP_WOODLANDS);
CardInfoManager.AddCard('5f0ce2b0-9e9b-4d1e-8c73-b55a7dd07963', TCardInfo.Create(ctDrop, [ecWhite], 'Units\White\HeavyGunnerDrop', 2));
CardInfoManager.AddCard('2af612dd-726d-4fa3-85ef-0d4192095da2', TCardInfo.Create(ctDrop, [ecWhite], 'Units\White\MarksmanDrop', 2));
CardInfoManager.AddSkin('2af612dd-726d-4fa3-85ef-0d4192095da2', '1a6dd801-e33b-4972-8b04-2d2e45277785', SKIN_GROUP_WOODLANDS);
CardInfoManager.AddCard('16bb2970-7977-4914-9d1c-287806f4e3db', TCardInfo.Create(ctDrop, [ecWhite], 'Units\White\PriestDrop', 1));
CardInfoManager.AddSkin('16bb2970-7977-4914-9d1c-287806f4e3db', '21eb2c26-9c50-4b30-977d-501dde0adb3e', SKIN_GROUP_WIP);
CardInfoManager.AddCard('f1dc5d00-f59f-4616-b3d7-beed8119cbad', TCardInfo.Create(ctDrop, [ecWhite], 'Units\White\MonkDrop', 1));
CardInfoManager.AddSkin('f1dc5d00-f59f-4616-b3d7-beed8119cbad', '686dfc20-b44c-49c7-9dff-6499237ad370', SKIN_GROUP_UNDERWORLD);
CardInfoManager.AddCard('d8e38876-95b0-4566-9185-fbac1d02e143', TCardInfo.Create(ctDrop, [ecWhite], 'Units\White\PatronSaintDrop', 3));
CardInfoManager.AddSkin('d8e38876-95b0-4566-9185-fbac1d02e143', '7beb986e-a8fa-460c-a054-44f7b866de16', SKIN_GROUP_MACHINE);
// building
CardInfoManager.AddCard('893292ed-8619-4514-b7e2-8cf80eceb397', TCardInfo.Create(ctBuilding, [ecWhite], 'Units\White\MonumentOfLightBuilding', 3));
CardInfoManager.AddSkin('893292ed-8619-4514-b7e2-8cf80eceb397', '40e8ec29-19d8-45f8-b450-d05127235bf4', SKIN_GROUP_SUMMER);
CardInfoManager.AddCard('3e6d5b8a-6d04-4427-9b8b-b498e7c4ee04', TCardInfo.Create(ctBuilding, [ecWhite], 'Units\White\SuntowerBuilding', 2));
// spells
CardInfoManager.AddCard('527dd787-d8e9-4817-b45a-13b72495dbf7', TCardInfo.Create(ctSpell, [ecWhite], 'Spells\White\HailOfArrows.sps', 2));
CardInfoManager.AddCard('a62ca9b8-35ec-4995-a44e-182fbe686523', TCardInfo.Create(ctSpell, [ecWhite], 'Spells\White\PromiseOfLife.sps', 2));
CardInfoManager.AddCard('c9ed10c4-bfda-4b7c-b8e9-e3c78981f9bf', TCardInfo.Create(ctSpell, [ecWhite], 'Spells\White\SurgeOfLight.sps', 1));
CardInfoManager.AddCard('e79286f7-cbea-474a-8717-7ef96bfd832a', TCardInfo.Create(ctSpell, [ecWhite], 'Spells\White\LightPulse.sps', 1));
CardInfoManager.AddCard('151333f7-1e43-4f80-9740-7ecf27da1404', TCardInfo.Create(ctSpell, [ecWhite], 'Spells\White\ShieldsUp.sps', 1));
CardInfoManager.AddCard('aea72381-f9fb-4bab-bd42-42548b20262a', TCardInfo.Create(ctSpell, [ecWhite], 'Spells\White\SolarFlare.sps', 3));
/// /// Green /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// spawner
CardInfoManager.AddCard('ad662053-56a2-4d57-bb17-288c43cc6612', TCardInfo.Create(ctSpawner, [ecGreen], 'Units\Green\GroundbreakerSpawner', 3));
CardInfoManager.AddCard('494c87c8-6df5-4b91-aa5c-53178be43ec8', TCardInfo.Create(ctSpawner, [ecGreen], 'Units\Green\WispSpawner', 1));
CardInfoManager.AddCard('d3b707ce-1619-4e14-a61c-bce039083381', TCardInfo.Create(ctSpawner, [ecGreen], 'Units\Green\OracleSpawner', 3));
CardInfoManager.AddSkin('d3b707ce-1619-4e14-a61c-bce039083381', '2a692620-505f-40ce-b020-0078850c08e2', SKIN_GROUP_UNDERWORLD);
CardInfoManager.AddSkin('d3b707ce-1619-4e14-a61c-bce039083381', 'acfd1d94-8ced-4d6b-beb0-77a68ae8678d', SKIN_GROUP_CRUSADER);
CardInfoManager.AddCard('82b5fa7d-b4f5-461a-be32-2366db17a24a', TCardInfo.Create(ctSpawner, [ecGreen], 'Units\Green\RootDudeSpawner', 2));
CardInfoManager.AddCard('32ac1b2a-c98a-4d6f-a25b-fef1c6d463dc', TCardInfo.Create(ctSpawner, [ecGreen], 'Units\Green\RootlingSpawner', 1));
CardInfoManager.AddSkin('32ac1b2a-c98a-4d6f-a25b-fef1c6d463dc', 'ff4ee4e9-17e0-46fb-8b8d-fffee797edbc', SKIN_GROUP_UNDERWORLD);
CardInfoManager.AddSkin('32ac1b2a-c98a-4d6f-a25b-fef1c6d463dc', '3bcbd07d-2df4-4139-afa0-4c82c0300c59', SKIN_GROUP_MACHINE);
CardInfoManager.AddCard('e47ee3c7-5acf-45a5-954e-bec81eda2022', TCardInfo.Create(ctSpawner, [ecGreen], 'Units\Green\ThistleSpawner', 1));
CardInfoManager.AddSkin('e47ee3c7-5acf-45a5-954e-bec81eda2022', 'd2d69998-cd26-4da8-948a-8e85897a152d', SKIN_GROUP_UNDERWORLD);
CardInfoManager.AddSkin('e47ee3c7-5acf-45a5-954e-bec81eda2022', 'eab283ff-e226-49a1-8a67-fcd9ea66e5cc', SKIN_GROUP_SCILL);
CardInfoManager.AddCard('ed0e3831-4b25-4437-9a88-797832387a95', TCardInfo.Create(ctSpawner, [ecGreen], 'Units\Green\WoodwalkerSpawner', 2), SKIN_GROUP_DEFAULT);
CardInfoManager.AddCard('08563ec3-ebb6-4865-9bcb-89aae6dc560c', TCardInfo.Create(ctSpawner, [ecGreen], 'Units\Green\HeartOfTheForestSpawner', 1));
CardInfoManager.AddCard('6be2f2c1-2916-4f85-84c4-1159d31596e6', TCardInfo.Create(ctSpawner, [ecGreen], 'Units\Green\SporeSpawner', 2));
CardInfoManager.AddCard('499b7ca8-b1f8-4c84-a2d1-8dd0660a4ce2', TCardInfo.Create(ctSpawner, [ecGreen], 'Units\Green\BrratuSpawner', 3));
CardInfoManager.AddCard('f51d56a6-8f25-4f53-ad2d-bb6e4b2c7c1c', TCardInfo.Create(ctSpawner, [ecGreen], 'Units\Green\SaplingSpawner', 1));
CardInfoManager.AddSkin('f51d56a6-8f25-4f53-ad2d-bb6e4b2c7c1c', '80bea52b-f377-44cb-a99d-8e39f8a2c7a5', SKIN_GROUP_SNOW);
// drops
CardInfoManager.AddCard('3e17f75d-eb92-4fbe-8e7e-857fdec8f3fe', TCardInfo.Create(ctDrop, [ecGreen], 'Units\Green\GroundbreakerDrop', 3));
CardInfoManager.AddCard('be51818a-4a38-47d1-a06e-178b60b23bfa', TCardInfo.Create(ctDrop, [ecGreen], 'Units\Green\WispDrop', 1));
CardInfoManager.AddCard('cb1b6a30-980c-4a2e-81ad-72c3b336b2ec', TCardInfo.Create(ctDrop, [ecGreen], 'Units\Green\OracleDrop', 3));
CardInfoManager.AddSkin('cb1b6a30-980c-4a2e-81ad-72c3b336b2ec', '67be9bf3-3e75-406b-ab07-f7c602bc67f7', SKIN_GROUP_UNDERWORLD);
CardInfoManager.AddSkin('cb1b6a30-980c-4a2e-81ad-72c3b336b2ec', '89083900-d2e8-453c-a94d-250db5f8dd95', SKIN_GROUP_CRUSADER);
CardInfoManager.AddCard('88064f15-f5bb-45f7-8170-b9caa19249db', TCardInfo.Create(ctDrop, [ecGreen], 'Units\Green\RootDudeDrop', 2));
CardInfoManager.AddCard('cc7f4ee1-ee58-47ff-9279-f4716aff562a', TCardInfo.Create(ctDrop, [ecGreen], 'Units\Green\RootlingDrop', 1));
CardInfoManager.AddSkin('cc7f4ee1-ee58-47ff-9279-f4716aff562a', '3a45787b-1ae9-4c2e-b886-b3d61c61f132', SKIN_GROUP_UNDERWORLD);
CardInfoManager.AddSkin('cc7f4ee1-ee58-47ff-9279-f4716aff562a', 'b188235d-b72b-43ea-8d0e-871577415578', SKIN_GROUP_MACHINE);
CardInfoManager.AddCard('cadcde81-8c98-4091-ad62-7bc9cc3e179a', TCardInfo.Create(ctDrop, [ecGreen], 'Units\Green\ThistleDrop', 1));
CardInfoManager.AddSkin('cadcde81-8c98-4091-ad62-7bc9cc3e179a', 'fb7e7ecd-be97-4507-9073-42459598f474', SKIN_GROUP_UNDERWORLD);
CardInfoManager.AddSkin('cadcde81-8c98-4091-ad62-7bc9cc3e179a', '0a25f4b6-87f2-442e-89c6-0b805997c9bb', SKIN_GROUP_SCILL);
CardInfoManager.AddCard('d55cdfba-c432-4b7e-9a7a-55a8b51e6a54', TCardInfo.Create(ctDrop, [ecGreen], 'Units\Green\WoodwalkerDrop', 2), SKIN_GROUP_DEFAULT);
CardInfoManager.AddCard('18a8178c-6954-44df-97ae-be44ea3bee1f', TCardInfo.Create(ctDrop, [ecGreen], 'Units\Green\HeartOfTheForestDrop', 1));
CardInfoManager.AddCard('b2635c4d-c693-403b-980a-cb2e45703078', TCardInfo.Create(ctDrop, [ecGreen], 'Units\Green\SporeDrop', 2));
CardInfoManager.AddCard('1b4dbb14-635e-4bc0-8c46-8d07fe3b526d', TCardInfo.Create(ctDrop, [ecGreen], 'Units\Green\BrratuDrop', 3));
CardInfoManager.AddSkin('1b4dbb14-635e-4bc0-8c46-8d07fe3b526d', 'f8af4151-a2af-4820-bb46-1c3ae9d021f4', SKIN_GROUP_UNDERWORLD);
CardInfoManager.AddCard('67e7217d-4b1a-4366-a3e5-b71bca952d1a', TCardInfo.Create(ctDrop, [ecGreen], 'Units\Green\SaplingDrop', 1));
CardInfoManager.AddSkin('67e7217d-4b1a-4366-a3e5-b71bca952d1a', 'e1eb10e7-6dae-420d-9ac7-49a80697f5cb', SKIN_GROUP_SNOW);
// buildings
CardInfoManager.AddCard('5e616d06-5022-4e13-8c1a-b16313d0a369', TCardInfo.Create(ctBuilding, [ecGreen], 'Units\Green\ForestGuardianBuilding', 2));
CardInfoManager.AddSkin('5e616d06-5022-4e13-8c1a-b16313d0a369', '068aaacc-50f4-4a06-9ce0-6f4c45c1f7a0', SKIN_GROUP_SPRING);
CardInfoManager.AddCard('745363e6-12ac-47dd-acaf-e6956b9c9526', TCardInfo.Create(ctBuilding, [ecGreen], 'Units\Green\SaplingFarmBuilding', 1));
CardInfoManager.AddSkin('745363e6-12ac-47dd-acaf-e6956b9c9526', '75b40857-3521-415c-a9ac-2841b32b0ad5', SKIN_GROUP_SNOW);
// spells
CardInfoManager.AddCard('902aa87b-7b2c-4508-91b9-bb20944c26d8', TCardInfo.Create(ctSpell, [ecGreen], 'Spells\Green\EntanglingRoots.sps', 1));
CardInfoManager.AddCard('e7399731-f68e-46d8-9c32-bc18679ba52e', TCardInfo.Create(ctSpell, [ecGreen], 'Spells\Green\GiantGrowth.sps', 1));
CardInfoManager.AddCard('a0c3d296-9f04-4cf3-b80d-7f207928b22d', TCardInfo.Create(ctSpell, [ecGreen], 'Spells\Green\EvolveThistle.sps', 3), SKIN_GROUP_DEFAULT);
CardInfoManager.AddCard('3b2e5e43-aa5c-4957-8d0f-9831e46846ea', TCardInfo.Create(ctSpell, [ecGreen], 'Spells\Green\EvolveOracle.sps', 2), SKIN_GROUP_DEFAULT);
CardInfoManager.AddCard('14501389-854c-4634-ac55-bf55950546f7', TCardInfo.Create(ctSpell, [ecGreen], 'Spells\Green\HealingGarden.sps', 2));
CardInfoManager.AddCard('6cccc3b4-4a60-4da9-bb06-04576bd9c2a9', TCardInfo.Create(ctSpell, [ecGreen], 'Spells\Green\SaplingCharge.sps', 3), SKIN_GROUP_DEFAULT);
/// /// Black /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// spawner
CardInfoManager.AddCard('1b2f89a9-d13f-408f-aae5-593fdffe1da3', TCardInfo.Create(ctSpawner, [ecBlack], 'Units\Black\VoidBaneSpawner', 1));
CardInfoManager.AddSkin('1b2f89a9-d13f-408f-aae5-593fdffe1da3', '930670b6-8ac4-48cd-b7dc-9c57faa77b46', SKIN_GROUP_CRUSADER);
CardInfoManager.AddSkin('1b2f89a9-d13f-408f-aae5-593fdffe1da3', 'b514a904-4ea2-450e-8a24-24ba01c3c706', SKIN_GROUP_RAINBOW);
CardInfoManager.AddCard('4db51640-3a58-447e-b743-a61ba44db1fc', TCardInfo.Create(ctSpawner, [ecBlack], 'Units\Black\VoidBowmanSpawner', 1));
CardInfoManager.AddSkin('4db51640-3a58-447e-b743-a61ba44db1fc', 'd8c812fc-a778-4c5a-bcaa-71014de6b0ab', SKIN_GROUP_RAINBOW);
CardInfoManager.AddCard('31f855cc-b85e-4325-b673-9de5ebb7389f', TCardInfo.Create(ctSpawner, [ecBlack], 'Units\Black\VoidSkeletonSpawner', 1));
CardInfoManager.AddSkin('31f855cc-b85e-4325-b673-9de5ebb7389f', '794315a1-00f4-4b3b-8e80-b19ad529a69b', SKIN_GROUP_CRUSADER);
CardInfoManager.AddCard('839aa57d-6080-422d-87d2-1361f830205a', TCardInfo.Create(ctSpawner, [ecBlack], 'Units\Black\VoidWormSpawner', 1));
CardInfoManager.AddSkin('839aa57d-6080-422d-87d2-1361f830205a', '543d70e8-9b66-493f-a9a9-8dd3930ce568', SKIN_GROUP_WOODLANDS);