-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlayer.py
More file actions
2461 lines (2423 loc) · 89.5 KB
/
Player.py
File metadata and controls
2461 lines (2423 loc) · 89.5 KB
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
import requests
import json
import re
class Player(object):
"""
Player
Instance Attributes
tag (str): The player's tag
name (str): The player's name
th_lvl (int): The player's home town hall level
th_weapon_lvl (int): The player's home town hall weapon level
not available if player has TH 11 or lower
xp_lvl (int): The player's experience level
trophies (int): current trophy count
best_trophies (int): max trophy amount
war_stars (int): amount of war stars earned
attack_wins (int): attack win count
current season
defense_wins (int): defense win count
current season
builder_hall_lvl (int): The player's builder hall level
not available if player has not unlocked builder hall
vs_trophies (int): current versus trophy count
best_vs_trophies (int): max versus trophy amount
vs_battle_wins (int):
role (str): The player's role in their clan
not available if player is not in a clan
donations (int): donations given
current season
donations_received (int): donations received
current season
clan_tag (str): tag of the clan the player is in
not available if player is not in a clan
clan_name (str): name of the clan the player is in
not available if player is not in a clan
clan_lvl (int): level of the clan the player is in
not available if player is not in a clan
clan_icons (dict): dict of clan icons
league_id (int): ID of the league the player is in
not available if player is not in a league
league_name (str): name of the league the player is in
not available if player is not in a league
league_icons (dict): dict of league icons
heroes (list): list of Hero objects
troops (list): list of Troop objects
spells (list): list of Spell objects
"""
def __init__(
self, tag, name, th_lvl, th_weapon_lvl, xp_lvl,
trophies, best_trophies, war_stars, attack_wins, defense_wins,
builder_hall_lvl, vs_trophies, best_vs_trophies, vs_battle_wins,
role, donations, donations_received, clan_tag, clan_name, clan_lvl,
clan_icons, league_id, league_name, league_icons,
heroes, troops, spells
):
self.tag = tag
self.name = name
self.th_lvl = th_lvl
self.th_weapon_lvl = th_weapon_lvl
self.xp_lvl = xp_lvl
self.trophies = trophies
self.best_trophies = best_trophies
self.war_stars = war_stars
self.attack_wins = attack_wins
self.defense_wins = defense_wins
self.builder_hall_lvl = builder_hall_lvl
self.vs_trophies = vs_trophies
self.best_vs_trophies = best_vs_trophies
self.vs_battle_wins = vs_battle_wins
self.role = role
self.donations = donations
self.donations_received = donations_received
self.clan_tag = clan_tag
self.clan_name = clan_name
self.clan_lvl = clan_lvl
self.clan_icons = clan_icons
self.league_id = league_id
self.league_name = league_name
self.league_icons = league_icons
self.heroes = heroes
self.troops = troops
self.spells = spells
def find_unit(self, unit_name):
"""
Take in a unit name and return the corresponding unit object.
If no unit is found returns None.
"""
# formatting the name from '-' to ' '
unit_name = re.sub('[-]', ' ', unit_name)
unit_name = re.sub('[.]', '', unit_name)
for hero in self.heroes:
if hero.name.lower() == unit_name.lower():
return hero
for troop in self.troops:
# formatting for P.E.K.K.A.
formatted_unit_name = re.sub('[.]', '', troop.name)
if formatted_unit_name.lower() == unit_name.lower():
return troop
for spell in self.spells:
if spell.name.lower() == unit_name.lower():
return spell
return None
def find_hero(self, hero_name):
"""
Take in a hero name and return the corresponding hero object.
If no hero is found returns None.
"""
# formatting the name from '-' to ' '
hero_name = re.sub('[-]', ' ', hero_name)
hero_name = re.sub('[.]', '', hero_name)
for hero in self.heroes:
if hero.name.lower() == hero_name.lower():
return hero
return None
def find_troop(self, troop_name):
"""
Take in a troop name and return the corresponding troop object.
If no troop is found returns None.
"""
# formatting the name from '-' to ' '
troop_name = re.sub('[-]', ' ', troop_name)
troop_name = re.sub('[.]', '', troop_name)
for troop in self.troops:
# formatting for P.E.K.K.A.
formatted_troop_name = re.sub('[.]', '', troop.name)
if formatted_troop_name.lower() == troop_name.lower():
return troop
return None
def find_spell(self, spell_name):
"""
Take in a spell name and return the corresponding spell object.
If no spell is found returns None.
"""
# formatting the name from '-' to ' '
spell_name = re.sub('[-]', ' ', spell_name)
spell_name = re.sub('[.]', '', spell_name)
for spell in self.spells:
if spell.name.lower() == spell_name.lower():
return spell
return None
class Hero(object):
"""
Hero
Instance Attributes
name (str): The name of the hero
lvl (int): The level of the Player's hero
max_lvl (int): The max level of the hero
th_max (int): Max hero level for the Player's town hall level
village (str): Base the hero comes from
'home' or 'builderBase'
"""
def __init__(self, name, lvl, max_lvl, th_max, village):
self.name = name
self.lvl = lvl
self.max_lvl = max_lvl
self.th_max = th_max
self.village = village
class Troop(object):
"""
Troop
Instance Attributes
name (str): The name of the troop
lvl (int): The level of the Player's troop
max_lvl (int): The max level of the troop
th_max (int): Max troop level for the Player's town hall level
village (str): Base the troop comes from
'home' or 'builderBase'
"""
def __init__(self, name, lvl, max_lvl, th_max, village):
self.name = name
self.lvl = lvl
self.max_lvl = max_lvl
self.th_max = th_max
self.village = village
class Spell(object):
"""
Spell
Instance Attributes
name (str): The name of the spell
lvl (int): The level of the Player's spell
max_lvl (int): The max level of the spell
th_max (int): Max spell level for the Player's town hall level
village (str): Base the spell comes from
'home' or 'builderBase'
"""
def __init__(self, name, lvl, max_lvl, th_max, village):
self.name = name
self.lvl = lvl
self.max_lvl = max_lvl
self.th_max = th_max
self.village = village
# todo make comments for inner workings of get method
# todo legends league stats
# ? include all troops whether they are unlocked or not
def get(tag, header):
"""Takes in a player's tag and returns a Player object"""
player_json = json_response(tag, header)
if 'reason' in player_json:
None
if 'townHallWeaponLevel' in player_json:
th_weap_lvl = player_json['townHallWeaponLevel']
else:
th_weap_lvl = None
if 'builderHallLevel' in player_json:
bh_lvl = player_json['builderHallLevel']
vs_trophies = player_json['versusTrophies']
best_vs_trophies = player_json['bestVersusTrophies']
vs_battle_wins = player_json['versusBattleWins']
else:
bh_lvl = None
vs_trophies = None
best_vs_trophies = None
vs_battle_wins = None
if 'clan' in player_json:
role = player_json['role']
clan_tag = player_json['clan']['tag']
clan_name = player_json['clan']['name']
clan_lvl = player_json['clan']['clanLevel']
clan_icons = {
'small': player_json['clan']['badgeUrls']['small'],
'medium': player_json['clan']['badgeUrls']['medium'],
'large': player_json['clan']['badgeUrls']['large']
}
else:
role = None
clan_tag = None
clan_name = None
clan_lvl = None
clan_icons = None
if 'league' in player_json:
league_id = player_json['league']['id']
league_name = player_json['league']['name']
league_icons = {
'tiny': player_json['league']['iconUrls']['tiny'],
'small': player_json['league']['iconUrls']['small'],
'medium': player_json['league']['iconUrls']['medium']
}
else:
league_id = None
league_name = None
league_icons = None
heroes = []
for hero in player_json['heroes']:
if hero['village'] == 'home':
heroes.append(Hero(
hero['name'], hero['level'], hero['maxLevel'],
troop_dict[player_json['townHallLevel']
]['hero'][hero['name']]['thMax'],
hero['village'])
)
troops = []
# siege machines are part of 'troops' in the player_json
for troop in player_json['troops']:
if (troop['village'] == 'home'
and troop['name'] not in super_troop_list):
troops.append(Troop(
troop['name'], troop['level'], troop['maxLevel'],
troop_dict[player_json['townHallLevel']
]['troop'][troop['name']]['thMax'],
troop['village'])
)
spells = []
for spell in player_json['spells']:
if spell['village'] == 'home':
spells.append(Spell(
spell['name'], spell['level'], spell['maxLevel'],
troop_dict[player_json['townHallLevel']
]['spell'][spell['name']]['thMax'],
spell['village'])
)
return Player(
tag, player_json['name'], player_json['townHallLevel'],
th_weap_lvl, player_json['expLevel'], player_json['trophies'],
player_json['bestTrophies'], player_json['warStars'],
player_json['attackWins'], player_json['defenseWins'],
bh_lvl, vs_trophies, best_vs_trophies, vs_battle_wins,
role, player_json['donations'], player_json['donationsReceived'],
clan_tag, clan_name, clan_lvl, clan_icons,
league_id, league_name, league_icons, heroes, troops, spells
)
def json_response(tag, header):
tag = tag[1:]
url = f'https://api.clashofclans.com/v1/players/%23{tag}'
return requests.get(url, headers=header).json()
super_troop_list = [
'Super Barbarian', 'Super Archer', 'Super Giant', 'Sneaky Goblin',
'Super Wall Breaker', 'Super Wizard', 'Inferno Dragon', 'Super Minion',
'Super Valkyrie', 'Super Witch', 'Ice Hound'
]
troop_dict = {
1: {
'hero': {
'Barbarian King': {
'name': 'Barbarian King', 'thMax': 0, 'type': 'Dark Elixir'
},
'Archer Queen': {
'name': 'Archer Queen', 'thMax': 0, 'type': 'Dark Elixir'
},
'Grand Warden': {
'name': 'Grand Warden', 'thMax': 0, 'type': 'Elixir'
},
'Royal Champion': {
'name': 'Royal Champion', 'thMax': 0, 'type': 'Dark Elixir'
}
},
'troop': {
'Barbarian': {
'name': 'Barbarian', 'thMax': 1, 'type': 'Elixir'
},
'Archer': {
'name': 'Archer', 'thMax': 1, 'type': 'Elixir'
},
'Giant': {
'name': 'Giant', 'thMax': 1, 'type': 'Elixir'
},
'Goblin': {
'name': 'Goblin', 'thMax': 0, 'type': 'Elixir'
},
'Wall Breaker': {
'name': 'Wall Breaker', 'thMax': 0, 'type': 'Elixir'
},
'Balloon': {
'name': 'Balloon', 'thMax': 0, 'type': 'Elixir'
},
'Wizard': {
'name': 'Wizard', 'thMax': 0, 'type': 'Elixir'
},
'Healer': {
'name': 'Healer', 'thMax': 0, 'type': 'Elixir'
},
'Dragon': {
'name': 'Dragon', 'thMax': 0, 'type': 'Elixir'
},
'P.E.K.K.A': {
'name': 'P.E.K.K.A', 'thMax': 0, 'type': 'Elixir'
},
'Baby Dragon': {
'name': 'Baby Dragon', 'thMax': 0, 'type': 'Elixir'
},
'Miner': {
'name': 'Miner', 'thMax': 0, 'type': 'Elixir'
},
'Electro Dragon': {
'name': 'Electro Dragon', 'thMax': 0, 'type': 'Elixir'
},
'Yeti': {
'name': 'Yeti', 'thMax': 0, 'type': 'Elixir'
},
'Super Barbarian': {
'name': 'Super Barbarian', 'thMax': 0, 'type': 'Elixir'
},
'Super Archer': {
'name': 'Super Archer', 'thMax': 0, 'type': 'Elixir'
},
'Super Wall Breaker': {
'name': 'Super Wall Breaker', 'thMax': 0, 'type': 'Elixir'
},
'Sneaky Goblin': {
'name': 'Sneaky Goblin', 'thMax': 0, 'type': 'Elixir'
},
'Super Giant': {
'name': 'Super Giant', 'thMax': 0, 'type': 'Elixir'
},
'Inferno Dragon': {
'name': 'Inferno Dragon', 'thMax': 0, 'type': 'Elixir'
},
'Super Valkyrie': {
'name': 'Super Valkyrie', 'thMax': 0, 'type': 'Dark Elixir'
},
'Super Witch': {
'name': 'Super Witch', 'thMax': 0, 'type': 'Dark Elixir'
},
'Minion': {
'name': 'Minion', 'thMax': 0, 'type': 'Dark Elixir'
},
'Hog Rider': {
'name': 'Hog Rider', 'thMax': 0, 'type': 'Dark Elixir'
},
'Valkyrie': {
'name': 'Valkyrie', 'thMax': 0, 'type': 'Dark Elixir'
},
'Golem': {
'name': 'Golem', 'thMax': 0, 'type': 'Dark Elixir'
},
'Witch': {
'name': 'Witch', 'thMax': 0, 'type': 'Dark Elixir'
},
'Lava Hound': {
'name': 'Lava Hound', 'thMax': 0, 'type': 'Dark Elixir'
},
'Bowler': {
'name': 'Bowler', 'thMax': 0, 'type': 'Dark Elixir'
},
'Ice Golem': {
'name': 'Ice Golem', 'thMax': 0, 'type': 'Dark Elixir'
},
'Headhunter': {
'name': 'Headhunter', 'thMax': 0, 'type': 'Dark Elixir'
},
'Wall Wrecker': {
'name': 'Wall Wrecker', 'thMax': 0, 'type': 'Gold'
},
'Battle Blimp': {
'name': 'Battle Blimp', 'thMax': 0, 'type': 'Gold'
},
'Stone Slammer': {
'name': 'Stone Slammer', 'thMax': 0, 'type': 'Gold'
},
'Siege Barracks': {
'name': 'Siege Barracks', 'thMax': 0, 'type': 'Gold'
},
'Log Launcher': {
'name': 'Log Launcher', 'thMax': 0, 'type': 'Gold'
}
},
'spell': {
'Lightning Spell': {
'name': 'Lightning Spell', 'thMax': 0, 'type': 'Elixir'
},
'Healing Spell': {
'name': 'Healing Spell', 'thMax': 0, 'type': 'Elixir'
},
'Rage Spell': {
'name': 'Rage Spell', 'thMax': 0, 'type': 'Elixir'
},
'Jump Spell': {
'name': 'Jump Spell', 'thMax': 0, 'type': 'Elixir'
},
'Freeze Spell': {
'name': 'Freeze Spell', 'thMax': 0, 'type': 'Elixir'
},
'Clone Spell': {
'name': 'Clone Spell', 'thMax': 0, 'type': 'Elixir'
},
'Invisibility Spell': {
'name': 'Invisibility Spell', 'thMax': 0, 'type': 'Elixir'
},
'Poison Spell': {
'name': 'Poison Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Earthquake Spell': {
'name': 'Earthquake Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Haste Spell': {
'name': 'Haste Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Skeleton Spell': {
'name': 'Skeleton Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Bat Spell': {
'name': 'Bat Spell', 'thMax': 0, 'type': 'Dark Elixir'
}
}
},
2: {
'hero': {
'Barbarian King': {
'name': 'Barbarian King', 'thMax': 0, 'type': 'Dark Elixir'
},
'Archer Queen': {
'name': 'Archer Queen', 'thMax': 0, 'type': 'Dark Elixir'
},
'Grand Warden': {
'name': 'Grand Warden', 'thMax': 0, 'type': 'Elixir'
},
'Royal Champion': {
'name': 'Royal Champion', 'thMax': 0, 'type': 'Dark Elixir'
}
},
'troop': {
'Barbarian': {
'name': 'Barbarian', 'thMax': 1, 'type': 'Elixir'
},
'Archer': {
'name': 'Archer', 'thMax': 1, 'type': 'Elixir'
},
'Giant': {
'name': 'Giant', 'thMax': 1, 'type': 'Elixir'
},
'Goblin': {
'name': 'Goblin', 'thMax': 1, 'type': 'Elixir'
},
'Wall Breaker': {
'name': 'Wall Breaker', 'thMax': 0, 'type': 'Elixir'
},
'Balloon': {
'name': 'Balloon', 'thMax': 0, 'type': 'Elixir'
},
'Wizard': {
'name': 'Wizard', 'thMax': 0, 'type': 'Elixir'
},
'Healer': {
'name': 'Healer', 'thMax': 0, 'type': 'Elixir'
},
'Dragon': {
'name': 'Dragon', 'thMax': 0, 'type': 'Elixir'
},
'P.E.K.K.A': {
'name': 'P.E.K.K.A', 'thMax': 0, 'type': 'Elixir'
},
'Baby Dragon': {
'name': 'Baby Dragon', 'thMax': 0, 'type': 'Elixir'
},
'Miner': {
'name': 'Miner', 'thMax': 0, 'type': 'Elixir'
},
'Electro Dragon': {
'name': 'Electro Dragon', 'thMax': 0, 'type': 'Elixir'
},
'Yeti': {
'name': 'Yeti', 'thMax': 0, 'type': 'Elixir'
},
'Super Barbarian': {
'name': 'Super Barbarian', 'thMax': 0, 'type': 'Elixir'
},
'Super Archer': {
'name': 'Super Archer', 'thMax': 0, 'type': 'Elixir'
},
'Super Wall Breaker': {
'name': 'Super Wall Breaker', 'thMax': 0, 'type': 'Elixir'
},
'Sneaky Goblin': {
'name': 'Sneaky Goblin', 'thMax': 0, 'type': 'Elixir'
},
'Super Giant': {
'name': 'Super Giant', 'thMax': 0, 'type': 'Elixir'
},
'Inferno Dragon': {
'name': 'Inferno Dragon', 'thMax': 0, 'type': 'Elixir'
},
'Super Valkyrie': {
'name': 'Super Valkyrie', 'thMax': 0, 'type': 'Dark Elixir'
},
'Super Witch': {
'name': 'Super Witch', 'thMax': 0, 'type': 'Dark Elixir'
},
'Minion': {
'name': 'Minion', 'thMax': 0, 'type': 'Dark Elixir'
},
'Hog Rider': {
'name': 'Hog Rider', 'thMax': 0, 'type': 'Dark Elixir'
},
'Valkyrie': {
'name': 'Valkyrie', 'thMax': 0, 'type': 'Dark Elixir'
},
'Golem': {
'name': 'Golem', 'thMax': 0, 'type': 'Dark Elixir'
},
'Witch': {
'name': 'Witch', 'thMax': 0, 'type': 'Dark Elixir'
},
'Lava Hound': {
'name': 'Lava Hound', 'thMax': 0, 'type': 'Dark Elixir'
},
'Bowler': {
'name': 'Bowler', 'thMax': 0, 'type': 'Dark Elixir'
},
'Ice Golem': {
'name': 'Ice Golem', 'thMax': 0, 'type': 'Dark Elixir'
},
'Headhunter': {
'name': 'Headhunter', 'thMax': 0, 'type': 'Dark Elixir'
},
'Wall Wrecker': {
'name': 'Wall Wrecker', 'thMax': 0, 'type': 'Gold'
},
'Battle Blimp': {
'name': 'Battle Blimp', 'thMax': 0, 'type': 'Gold'
},
'Stone Slammer': {
'name': 'Stone Slammer', 'thMax': 0, 'type': 'Gold'
},
'Siege Barracks': {
'name': 'Siege Barracks', 'thMax': 0, 'type': 'Gold'
},
'Log Launcher': {
'name': 'Log Launcher', 'thMax': 0, 'type': 'Gold'
}
},
'spell': {
'Lightning Spell': {
'name': 'Lightning Spell', 'thMax': 0, 'type': 'Elixir'
},
'Healing Spell': {
'name': 'Healing Spell', 'thMax': 0, 'type': 'Elixir'
},
'Rage Spell': {
'name': 'Rage Spell', 'thMax': 0, 'type': 'Elixir'
},
'Jump Spell': {
'name': 'Jump Spell', 'thMax': 0, 'type': 'Elixir'
},
'Freeze Spell': {
'name': 'Freeze Spell', 'thMax': 0, 'type': 'Elixir'
},
'Clone Spell': {
'name': 'Clone Spell', 'thMax': 0, 'type': 'Elixir'
},
'Invisibility Spell': {
'name': 'Invisibility Spell', 'thMax': 0, 'type': 'Elixir'
},
'Poison Spell': {
'name': 'Poison Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Earthquake Spell': {
'name': 'Earthquake Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Haste Spell': {
'name': 'Haste Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Skeleton Spell': {
'name': 'Skeleton Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Bat Spell': {
'name': 'Bat Spell', 'thMax': 0, 'type': 'Dark Elixir'
}
}
},
3: {
'hero': {
'Barbarian King': {
'name': 'Barbarian King', 'thMax': 0, 'type': 'Dark Elixir'
},
'Archer Queen': {
'name': 'Archer Queen', 'thMax': 0, 'type': 'Dark Elixir'
},
'Grand Warden': {
'name': 'Grand Warden', 'thMax': 0, 'type': 'Elixir'
},
'Royal Champion': {
'name': 'Royal Champion', 'thMax': 0, 'type': 'Dark Elixir'
}
},
'troop': {
'Barbarian': {
'name': 'Barbarian', 'thMax': 2, 'type': 'Elixir'
},
'Archer': {
'name': 'Archer', 'thMax': 2, 'type': 'Elixir'
},
'Giant': {
'name': 'Giant', 'thMax': 1, 'type': 'Elixir'
},
'Goblin': {
'name': 'Goblin', 'thMax': 2, 'type': 'Elixir'
},
'Wall Breaker': {
'name': 'Wall Breaker', 'thMax': 1, 'type': 'Elixir'
},
'Balloon': {
'name': 'Balloon', 'thMax': 0, 'type': 'Elixir'
},
'Wizard': {
'name': 'Wizard', 'thMax': 0, 'type': 'Elixir'
},
'Healer': {
'name': 'Healer', 'thMax': 0, 'type': 'Elixir'
},
'Dragon': {
'name': 'Dragon', 'thMax': 0, 'type': 'Elixir'
},
'P.E.K.K.A': {
'name': 'P.E.K.K.A', 'thMax': 0, 'type': 'Elixir'
},
'Baby Dragon': {
'name': 'Baby Dragon', 'thMax': 0, 'type': 'Elixir'
},
'Miner': {
'name': 'Miner', 'thMax': 0, 'type': 'Elixir'
},
'Electro Dragon': {
'name': 'Electro Dragon', 'thMax': 0, 'type': 'Elixir'
},
'Yeti': {
'name': 'Yeti', 'thMax': 0, 'type': 'Elixir'
},
'Super Barbarian': {
'name': 'Super Barbarian', 'thMax': 0, 'type': 'Elixir'
},
'Super Archer': {
'name': 'Super Archer', 'thMax': 0, 'type': 'Elixir'
},
'Super Wall Breaker': {
'name': 'Super Wall Breaker', 'thMax': 0, 'type': 'Elixir'
},
'Sneaky Goblin': {
'name': 'Sneaky Goblin', 'thMax': 0, 'type': 'Elixir'
},
'Super Giant': {
'name': 'Super Giant', 'thMax': 0, 'type': 'Elixir'
},
'Inferno Dragon': {
'name': 'Inferno Dragon', 'thMax': 0, 'type': 'Elixir'
},
'Super Valkyrie': {
'name': 'Super Valkyrie', 'thMax': 0, 'type': 'Dark Elixir'
},
'Super Witch': {
'name': 'Super Witch', 'thMax': 0, 'type': 'Dark Elixir'
},
'Minion': {
'name': 'Minion', 'thMax': 0, 'type': 'Dark Elixir'
},
'Hog Rider': {
'name': 'Hog Rider', 'thMax': 0, 'type': 'Dark Elixir'
},
'Valkyrie': {
'name': 'Valkyrie', 'thMax': 0, 'type': 'Dark Elixir'
},
'Golem': {
'name': 'Golem', 'thMax': 0, 'type': 'Dark Elixir'
},
'Witch': {
'name': 'Witch', 'thMax': 0, 'type': 'Dark Elixir'
},
'Lava Hound': {
'name': 'Lava Hound', 'thMax': 0, 'type': 'Dark Elixir'
},
'Bowler': {
'name': 'Bowler', 'thMax': 0, 'type': 'Dark Elixir'
},
'Ice Golem': {
'name': 'Ice Golem', 'thMax': 0, 'type': 'Dark Elixir'
},
'Headhunter': {
'name': 'Headhunter', 'thMax': 0, 'type': 'Dark Elixir'
},
'Wall Wrecker': {
'name': 'Wall Wrecker', 'thMax': 0, 'type': 'Gold'
},
'Battle Blimp': {
'name': 'Battle Blimp', 'thMax': 0, 'type': 'Gold'
},
'Stone Slammer': {
'name': 'Stone Slammer', 'thMax': 0, 'type': 'Gold'
},
'Siege Barracks': {
'name': 'Siege Barracks', 'thMax': 0, 'type': 'Gold'
},
'Log Launcher': {
'name': 'Log Launcher', 'thMax': 0, 'type': 'Gold'
}
},
'spell': {
'Lightning Spell': {
'name': 'Lightning Spell', 'thMax': 0, 'type': 'Elixir'
},
'Healing Spell': {
'name': 'Healing Spell', 'thMax': 0, 'type': 'Elixir'
},
'Rage Spell': {
'name': 'Rage Spell', 'thMax': 0, 'type': 'Elixir'
},
'Jump Spell': {
'name': 'Jump Spell', 'thMax': 0, 'type': 'Elixir'
},
'Freeze Spell': {
'name': 'Freeze Spell', 'thMax': 0, 'type': 'Elixir'
},
'Clone Spell': {
'name': 'Clone Spell', 'thMax': 0, 'type': 'Elixir'
},
'Invisibility Spell': {
'name': 'Invisibility Spell', 'thMax': 0, 'type': 'Elixir'
},
'Poison Spell': {
'name': 'Poison Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Earthquake Spell': {
'name': 'Earthquake Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Haste Spell': {
'name': 'Haste Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Skeleton Spell': {
'name': 'Skeleton Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Bat Spell': {
'name': 'Bat Spell', 'thMax': 0, 'type': 'Dark Elixir'
}
}
},
4: {
'hero': {
'Barbarian King': {
'name': 'Barbarian King', 'thMax': 0, 'type': 'Dark Elixir'
},
'Archer Queen': {
'name': 'Archer Queen', 'thMax': 0, 'type': 'Dark Elixir'
},
'Grand Warden': {
'name': 'Grand Warden', 'thMax': 0, 'type': 'Elixir'
},
'Royal Champion': {
'name': 'Royal Champion', 'thMax': 0, 'type': 'Dark Elixir'
}
},
'troop': {
'Barbarian': {
'name': 'Barbarian', 'thMax': 2, 'type': 'Elixir'
},
'Archer': {
'name': 'Archer', 'thMax': 2, 'type': 'Elixir'
},
'Giant': {
'name': 'Giant', 'thMax': 2, 'type': 'Elixir'
},
'Goblin': {
'name': 'Goblin', 'thMax': 2, 'type': 'Elixir'
},
'Wall Breaker': {
'name': 'Wall Breaker', 'thMax': 2, 'type': 'Elixir'
},
'Balloon': {
'name': 'Balloon', 'thMax': 2, 'type': 'Elixir'
},
'Wizard': {
'name': 'Wizard', 'thMax': 0, 'type': 'Elixir'
},
'Healer': {
'name': 'Healer', 'thMax': 0, 'type': 'Elixir'
},
'Dragon': {
'name': 'Dragon', 'thMax': 0, 'type': 'Elixir'
},
'P.E.K.K.A': {
'name': 'P.E.K.K.A', 'thMax': 0, 'type': 'Elixir'
},
'Baby Dragon': {
'name': 'Baby Dragon', 'thMax': 0, 'type': 'Elixir'
},
'Miner': {
'name': 'Miner', 'thMax': 0, 'type': 'Elixir'
},
'Electro Dragon': {
'name': 'Electro Dragon', 'thMax': 0, 'type': 'Elixir'
},
'Yeti': {
'name': 'Yeti', 'thMax': 0, 'type': 'Elixir'
},
'Super Barbarian': {
'name': 'Super Barbarian', 'thMax': 0, 'type': 'Elixir'
},
'Super Archer': {
'name': 'Super Archer', 'thMax': 0, 'type': 'Elixir'
},
'Super Wall Breaker': {
'name': 'Super Wall Breaker', 'thMax': 0, 'type': 'Elixir'
},
'Sneaky Goblin': {
'name': 'Sneaky Goblin', 'thMax': 0, 'type': 'Elixir'
},
'Super Giant': {
'name': 'Super Giant', 'thMax': 0, 'type': 'Elixir'
},
'Inferno Dragon': {
'name': 'Inferno Dragon', 'thMax': 0, 'type': 'Elixir'
},
'Super Valkyrie': {
'name': 'Super Valkyrie', 'thMax': 0, 'type': 'Dark Elixir'
},
'Super Witch': {
'name': 'Super Witch', 'thMax': 0, 'type': 'Dark Elixir'
},
'Minion': {
'name': 'Minion', 'thMax': 0, 'type': 'Dark Elixir'
},
'Hog Rider': {
'name': 'Hog Rider', 'thMax': 0, 'type': 'Dark Elixir'
},
'Valkyrie': {
'name': 'Valkyrie', 'thMax': 0, 'type': 'Dark Elixir'
},
'Golem': {
'name': 'Golem', 'thMax': 0, 'type': 'Dark Elixir'
},
'Witch': {
'name': 'Witch', 'thMax': 0, 'type': 'Dark Elixir'
},
'Lava Hound': {
'name': 'Lava Hound', 'thMax': 0, 'type': 'Dark Elixir'
},
'Bowler': {
'name': 'Bowler', 'thMax': 0, 'type': 'Dark Elixir'
},
'Ice Golem': {
'name': 'Ice Golem', 'thMax': 0, 'type': 'Dark Elixir'
},
'Headhunter': {
'name': 'Headhunter', 'thMax': 0, 'type': 'Dark Elixir'
},
'Wall Wrecker': {
'name': 'Wall Wrecker', 'thMax': 0, 'type': 'Gold'
},
'Battle Blimp': {
'name': 'Battle Blimp', 'thMax': 0, 'type': 'Gold'
},
'Stone Slammer': {
'name': 'Stone Slammer', 'thMax': 0, 'type': 'Gold'
},
'Siege Barracks': {
'name': 'Siege Barracks', 'thMax': 0, 'type': 'Gold'
},
'Log Launcher': {
'name': 'Log Launcher', 'thMax': 0, 'type': 'Gold'
}
},
'spell': {
'Lightning Spell': {
'name': 'Lightning Spell', 'thMax': 0, 'type': 'Elixir'
},
'Healing Spell': {
'name': 'Healing Spell', 'thMax': 0, 'type': 'Elixir'
},
'Rage Spell': {
'name': 'Rage Spell', 'thMax': 0, 'type': 'Elixir'
},
'Jump Spell': {
'name': 'Jump Spell', 'thMax': 0, 'type': 'Elixir'
},
'Freeze Spell': {
'name': 'Freeze Spell', 'thMax': 0, 'type': 'Elixir'
},
'Clone Spell': {
'name': 'Clone Spell', 'thMax': 0, 'type': 'Elixir'
},
'Invisibility Spell': {
'name': 'Invisibility Spell', 'thMax': 0, 'type': 'Elixir'
},
'Poison Spell': {
'name': 'Poison Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Earthquake Spell': {
'name': 'Earthquake Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Haste Spell': {
'name': 'Haste Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Skeleton Spell': {
'name': 'Skeleton Spell', 'thMax': 0, 'type': 'Dark Elixir'
},
'Bat Spell': {
'name': 'Bat Spell', 'thMax': 0, 'type': 'Dark Elixir'
}
}
},
5: {
'hero': {
'Barbarian King': {
'name': 'Barbarian King', 'thMax': 0, 'type': 'Dark Elixir'
},
'Archer Queen': {
'name': 'Archer Queen', 'thMax': 0, 'type': 'Dark Elixir'
},
'Grand Warden': {
'name': 'Grand Warden', 'thMax': 0, 'type': 'Elixir'
},
'Royal Champion': {
'name': 'Royal Champion', 'thMax': 0, 'type': 'Dark Elixir'
}
},
'troop': {
'Barbarian': {