clashofclans.js 2.0.0-dev.dedb83d → 2.0.1-dev.ba82327

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import { OverrideOptions } from '../rest/RequestHandler';
1
2
  import { LegendStatistics } from './LegendStatistics';
2
3
  import { Achievement } from './Achievement';
3
4
  import { Hero, Spell, Troop } from './Unit';
@@ -63,7 +64,7 @@ export declare class Player {
63
64
  heroes: Hero[];
64
65
  constructor(client: Client, data: APIPlayer);
65
66
  /** Fetch detailed clan info for the player's clan. */
66
- fetchClan(): Promise<import("./Clan").Clan | null>;
67
+ fetchClan(options?: OverrideOptions): Promise<import("./Clan").Clan | null>;
67
68
  /** An array of the player's home base troops. */
68
69
  get homeTroops(): Troop[];
69
70
  /** An array of the player's builder base troops. */
@@ -2,12 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Player = void 0;
4
4
  const Constants_1 = require("../util/Constants");
5
+ const raw_json_1 = require("../util/raw.json");
5
6
  const LegendStatistics_1 = require("./LegendStatistics");
6
7
  const Achievement_1 = require("./Achievement");
7
8
  const Unit_1 = require("./Unit");
8
9
  const PlayerClan_1 = require("./PlayerClan");
9
10
  const League_1 = require("./League");
10
11
  const Label_1 = require("./Label");
12
+ const UNIT_NAMES = [...raw_json_1.RAW_UNITS.map((unit) => unit.name), ...raw_json_1.RAW_SUPER_UNITS.map((unit) => unit.name)];
11
13
  /** Represents a Clash of Clans Player. */
12
14
  class Player {
13
15
  constructor(client, data) {
@@ -36,15 +38,15 @@ class Player {
36
38
  this.legendStatistics = data.legendStatistics ? new LegendStatistics_1.LegendStatistics(data.legendStatistics) : null;
37
39
  this.achievements = data.achievements.map((data) => new Achievement_1.Achievement(data));
38
40
  this.labels = data.labels.map((data) => new Label_1.Label(data));
39
- this.troops = data.troops.map((data) => new Unit_1.Troop(data));
40
- this.spells = data.spells.map((data) => new Unit_1.Spell(data));
41
- this.heroes = data.heroes.map((data) => new Unit_1.Hero(data));
41
+ this.troops = data.troops.filter((unit) => UNIT_NAMES.includes(unit.name)).map((unit) => new Unit_1.Troop(data, unit));
42
+ this.spells = data.spells.filter((unit) => UNIT_NAMES.includes(unit.name)).map((unit) => new Unit_1.Spell(data, unit));
43
+ this.heroes = data.heroes.filter((unit) => UNIT_NAMES.includes(unit.name)).map((unit) => new Unit_1.Hero(data, unit));
42
44
  }
43
45
  /** Fetch detailed clan info for the player's clan. */
44
- async fetchClan() {
46
+ async fetchClan(options) {
45
47
  if (!this.clan)
46
48
  return null;
47
- return this.client.getClan(this.clan.tag);
49
+ return this.client.getClan(this.clan.tag, options);
48
50
  }
49
51
  /** An array of the player's home base troops. */
50
52
  get homeTroops() {
@@ -1,18 +1,23 @@
1
+ import { OverrideOptions } from '../rest/RequestHandler';
1
2
  import { Client } from '../client/Client';
2
3
  import { APIPlayerClan } from '../types';
3
4
  import { Badge } from './Badge';
4
- /** Represents a player's clan. */
5
+ /** Represents a Player's clan. */
5
6
  export declare class PlayerClan {
6
7
  private readonly _client;
7
8
  /** Name of the clan. */
8
9
  name: string;
9
10
  /** Tag of the clan. */
10
11
  tag: string;
11
- /** Level of this clan. */
12
- level: number;
12
+ /**
13
+ * Level of this clan.
14
+ *
15
+ * This property is not available for ranked player's clan.
16
+ */
17
+ level: number | null;
13
18
  /** Badge of this clan. */
14
19
  badge: Badge;
15
20
  constructor(_client: Client, data: APIPlayerClan);
16
21
  /** Fetch detailed clan info for the player's clan. */
17
- fetch(): Promise<import("./Clan").Clan>;
22
+ fetch(options?: OverrideOptions): Promise<import("./Clan").Clan>;
18
23
  }
@@ -2,18 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PlayerClan = void 0;
4
4
  const Badge_1 = require("./Badge");
5
- /** Represents a player's clan. */
5
+ /** Represents a Player's clan. */
6
6
  class PlayerClan {
7
7
  constructor(_client, data) {
8
8
  this._client = _client;
9
9
  this.name = data.name;
10
10
  this.tag = data.tag;
11
- this.level = data.clanLevel;
11
+ this.level = data.clanLevel ?? null; // eslint-disable-line
12
12
  this.badge = new Badge_1.Badge(data.badgeUrls);
13
13
  }
14
14
  /** Fetch detailed clan info for the player's clan. */
15
- fetch() {
16
- return this._client.getClan(this.tag);
15
+ fetch(options) {
16
+ return this._client.getClan(this.tag, options);
17
17
  }
18
18
  }
19
19
  exports.PlayerClan = PlayerClan;
@@ -4,7 +4,27 @@ import { Client } from '../client/Client';
4
4
  import { Location } from './Location';
5
5
  import { League } from './League';
6
6
  import { Badge } from './Badge';
7
- /** Represents the player of leader-board ranking. */
7
+ /** Represents the Player of seasonal legend league leader-board ranking. */
8
+ export declare class SeasonRankedPlayer {
9
+ /** The player's name. */
10
+ name: string;
11
+ /** The player's tag. */
12
+ tag: string;
13
+ /** The player's experience level. */
14
+ expLevel: number;
15
+ /** The player's trophy count. */
16
+ trophies: number;
17
+ /** The player's attack wins. */
18
+ attackWins: number;
19
+ /** The player's defense wins. */
20
+ defenseWins: number;
21
+ /** The player's rank in the clan leader-board. */
22
+ rank: number;
23
+ /** The player's clan. */
24
+ clan: PlayerClan | null;
25
+ constructor(client: Client, data: Omit<APIPlayerRanking, 'league'>);
26
+ }
27
+ /** Represents the Player of location based leader-board ranking. */
8
28
  export declare class RankedPlayer {
9
29
  /** The player's name. */
10
30
  name: string;
@@ -24,15 +44,15 @@ export declare class RankedPlayer {
24
44
  versusBattleWins: number | null;
25
45
  /** The player's rank in the clan leader-board. */
26
46
  rank: number;
27
- /** The player's rank before the last leader-board change. */
28
- previousRank: number;
47
+ /** The player's rank before the last leader-board change. If retrieving info for legend league season, this will be `null`. */
48
+ previousRank: number | null;
29
49
  /** The player's clan. */
30
- clan: PlayerClan;
50
+ clan: PlayerClan | null;
31
51
  /** The player's league. If retrieving info for versus leader-boards, this will be `null`. */
32
52
  league: League | null;
33
53
  constructor(client: Client, data: APIPlayerRanking | APIPlayerVersusRanking);
34
54
  }
35
- /** Represents the clan of leader-board ranking. */
55
+ /** Represents the Clan of location based leader-board ranking. */
36
56
  export declare class RankedClan {
37
57
  /** The clan's name. */
38
58
  name: string;
@@ -1,12 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RankedClan = exports.RankedPlayer = void 0;
3
+ exports.RankedClan = exports.RankedPlayer = exports.SeasonRankedPlayer = void 0;
4
4
  const Constants_1 = require("../util/Constants");
5
5
  const PlayerClan_1 = require("./PlayerClan");
6
6
  const Location_1 = require("./Location");
7
7
  const League_1 = require("./League");
8
8
  const Badge_1 = require("./Badge");
9
- /** Represents the player of leader-board ranking. */
9
+ /** Represents the Player of seasonal legend league leader-board ranking. */
10
+ class SeasonRankedPlayer {
11
+ constructor(client, data) {
12
+ this.name = data.name;
13
+ this.tag = data.tag;
14
+ this.rank = data.rank;
15
+ this.expLevel = data.expLevel;
16
+ this.trophies = data.trophies;
17
+ this.attackWins = data.attackWins;
18
+ this.defenseWins = data.defenseWins;
19
+ // @ts-expect-error
20
+ this.clan = data.clan ? new PlayerClan_1.PlayerClan(client, data.clan) : null;
21
+ }
22
+ }
23
+ exports.SeasonRankedPlayer = SeasonRankedPlayer;
24
+ /** Represents the Player of location based leader-board ranking. */
10
25
  class RankedPlayer {
11
26
  constructor(client, data) {
12
27
  this.name = data.name;
@@ -23,14 +38,15 @@ class RankedPlayer {
23
38
  // @ts-expect-error
24
39
  this.versusBattleWins = data.versusBattleWins ?? null;
25
40
  this.rank = data.rank;
26
- this.previousRank = data.previousRank;
27
- this.clan = new PlayerClan_1.PlayerClan(client, data.clan);
41
+ this.previousRank = data.previousRank ?? null; // eslint-disable-line
42
+ // @ts-expect-error
43
+ this.clan = data.clan ? new PlayerClan_1.PlayerClan(client, data.clan) : null;
28
44
  // @ts-expect-error
29
45
  this.league = data.trophies ? new League_1.League(data.league ?? Constants_1.UNRANKED_LEAGUE_DATA) : null; // eslint-disable-line
30
46
  }
31
47
  }
32
48
  exports.RankedPlayer = RankedPlayer;
33
- /** Represents the clan of leader-board ranking. */
49
+ /** Represents the Clan of location based leader-board ranking. */
34
50
  class RankedClan {
35
51
  constructor(data) {
36
52
  this.name = data.name;
@@ -1,4 +1,4 @@
1
- import { APIPlayerItem } from '../types';
1
+ import { APIPlayerItem, APIPlayer } from '../types';
2
2
  /** Represents a player's unit. */
3
3
  export declare class Unit {
4
4
  /** The name of this unit. */
@@ -9,7 +9,35 @@ export declare class Unit {
9
9
  maxLevel: number;
10
10
  /** The village type of this unit. */
11
11
  village: 'home' | 'builderBase';
12
- constructor(data: APIPlayerItem);
12
+ /** Id of this unit. */
13
+ id: number;
14
+ /** Housing space of this unit. */
15
+ housingSpace: number;
16
+ /** Town/Builder hall's max level of this unit. */
17
+ hallMaxLevel: number;
18
+ /** Unlock Town/Builder Hall level of this unit. */
19
+ unlockHallLevel: number;
20
+ /** Unlock cost of this unit. */
21
+ unlockCost: number;
22
+ /** Unlock time of this unit. */
23
+ unlockTime: number;
24
+ /** Unlock resource of this unit. */
25
+ unlockResource: string;
26
+ /** Unlock building of this unit. */
27
+ unlockBuilding: string;
28
+ /** Unlock building level of this unit. */
29
+ unlockBuildingLevel: number;
30
+ /** Upgrade cost of this unit. */
31
+ upgradeCost: number;
32
+ /** Upgrade resource of this unit. */
33
+ upgradeResource: string;
34
+ /** Upgrade time of this unit. */
35
+ upgradeTime: number;
36
+ /** @internal */
37
+ minOriginalLevel: number | null;
38
+ /** @internal */
39
+ originalName: string | null;
40
+ constructor(data: APIPlayer, unit: APIPlayerItem);
13
41
  /** Whether the unit belongs to the home base. */
14
42
  get isHomeBase(): boolean;
15
43
  /** Whether the unit belongs to the builder base. */
@@ -22,8 +50,13 @@ export declare class Unit {
22
50
  /** Represents a player's troop. */
23
51
  export declare class Troop extends Unit {
24
52
  name: string;
25
- superTroopIsActive: boolean;
26
- constructor(data: APIPlayerItem);
53
+ /** Whether this troop is currently active of boosted. */
54
+ isActive: boolean;
55
+ /** Origin troop's minimum level of this super troop. */
56
+ minOriginalLevel: number | null;
57
+ /** Origin troop's name of this super troop. */
58
+ originalName: string | null;
59
+ constructor(data: APIPlayer, unit: APIPlayerItem);
27
60
  /** Whether this troop is a Super Troop. */
28
61
  get isSuperTroop(): boolean;
29
62
  }
@@ -1,14 +1,52 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Hero = exports.Spell = exports.Troop = exports.Unit = void 0;
4
+ const raw_json_1 = require("../util/raw.json");
4
5
  const Constants_1 = require("../util/Constants");
5
6
  /** Represents a player's unit. */
6
7
  class Unit {
7
- constructor(data) {
8
- this.name = data.name;
9
- this.level = data.level;
10
- this.maxLevel = data.maxLevel;
11
- this.village = data.village;
8
+ // #endregion static
9
+ constructor(data, unit) {
10
+ this.name = unit.name;
11
+ this.level = unit.level;
12
+ this.maxLevel = unit.maxLevel;
13
+ this.village = unit.village;
14
+ const rawSuperUnit = raw_json_1.RAW_SUPER_UNITS.find((unit) => unit.name === this.name && this.isHomeBase);
15
+ const rawUnit = raw_json_1.RAW_UNITS.find((unit) => unit.name === this.name && unit.village === this.village);
16
+ if (rawSuperUnit) {
17
+ this.id = rawSuperUnit.id;
18
+ this.housingSpace = rawSuperUnit.housingSpace;
19
+ this.originalName = rawSuperUnit.original;
20
+ this.minOriginalLevel = rawSuperUnit.minOriginalLevel;
21
+ const original = raw_json_1.RAW_UNITS.find((unit) => unit.village === 'home' && unit.name === rawSuperUnit.original);
22
+ this.unlockHallLevel = original.levels.findIndex((level) => level >= rawSuperUnit.minOriginalLevel) + 1;
23
+ this.unlockCost = original.unlock.cost;
24
+ this.unlockTime = original.unlock.time;
25
+ this.unlockResource = original.unlock.resource;
26
+ this.unlockBuilding = original.unlock.building;
27
+ this.unlockBuildingLevel = original.unlock.buildingLevel;
28
+ const origin = data.troops.find((troop) => troop.village === 'home' && troop.name === original.name);
29
+ this.level = origin.level;
30
+ this.maxLevel = origin.maxLevel;
31
+ this.upgradeCost = original.upgrade.cost[origin.level - 1] ?? 0;
32
+ this.upgradeResource = original.upgrade.resource;
33
+ this.upgradeTime = original.upgrade.time[origin.level - 1] ?? 0;
34
+ this.hallMaxLevel = original.levels[data.townHallLevel - 1];
35
+ }
36
+ if (rawUnit) {
37
+ this.id = rawUnit.id;
38
+ this.housingSpace = rawUnit.housingSpace;
39
+ this.unlockCost = rawUnit.unlock.cost;
40
+ this.unlockTime = rawUnit.unlock.time;
41
+ this.unlockResource = rawUnit.unlock.resource;
42
+ this.unlockBuilding = rawUnit.unlock.building;
43
+ this.unlockHallLevel = rawUnit.unlock.hall;
44
+ this.unlockBuildingLevel = rawUnit.unlock.buildingLevel;
45
+ this.upgradeResource = rawUnit.upgrade.resource;
46
+ this.upgradeCost = rawUnit.upgrade.cost[this.level - 1] ?? 0;
47
+ this.upgradeTime = rawUnit.upgrade.time[this.level - 1] ?? 0;
48
+ this.hallMaxLevel = rawUnit.levels[(this.village === 'home' ? data.townHallLevel : data.builderHallLevel) - 1];
49
+ }
12
50
  }
13
51
  /** Whether the unit belongs to the home base. */
14
52
  get isHomeBase() {
@@ -30,13 +68,15 @@ class Unit {
30
68
  exports.Unit = Unit;
31
69
  /** Represents a player's troop. */
32
70
  class Troop extends Unit {
33
- constructor(data) {
34
- super(data);
35
- this.superTroopIsActive = data.superTroopIsActive ?? false;
71
+ constructor(data, unit) {
72
+ super(data, unit);
73
+ this.originalName = this.originalName ?? null;
74
+ this.isActive = unit.superTroopIsActive ?? false;
75
+ this.minOriginalLevel = this.minOriginalLevel ?? null;
36
76
  }
37
77
  /** Whether this troop is a Super Troop. */
38
78
  get isSuperTroop() {
39
- return this.superTroopIsActive || (this.isHomeBase && Constants_1.SUPER_TROOPS.includes(this.name));
79
+ return this.isActive || (this.isHomeBase && Constants_1.SUPER_TROOPS.includes(this.name));
40
80
  }
41
81
  }
42
82
  exports.Troop = Troop;
@@ -1,5 +1,3 @@
1
- export declare type APIWarState = 'notInWar' | 'preparation' | 'inWar' | 'warEnded';
2
- export declare type APIRole = 'member' | 'admin' | 'coLeader' | 'leader';
3
1
  export interface APIPaging {
4
2
  cursors?: APICursors;
5
3
  }
@@ -62,7 +60,7 @@ export interface APIClan {
62
60
  export interface APIClanMember {
63
61
  name: string;
64
62
  tag: string;
65
- role: APIRole;
63
+ role: 'member' | 'admin' | 'coLeader' | 'leader';
66
64
  expLevel: number;
67
65
  league: APILeague;
68
66
  trophies: number;
@@ -79,7 +77,7 @@ export interface APIClanMemberList {
79
77
  }
80
78
  /** /clans/{clanTag}/currentwar and /clanwarleagues/wars/{warTag} */
81
79
  export interface APIClanWar {
82
- state: APIWarState;
80
+ state: 'notInWar' | 'preparation' | 'inWar' | 'warEnded';
83
81
  teamSize: number;
84
82
  startTime: string;
85
83
  preparationStartTime: string;
@@ -268,7 +266,7 @@ export interface APIPlayerRanking {
268
266
  defenseWins: number;
269
267
  rank: number;
270
268
  previousRank: number;
271
- clan: APIPlayerClan;
269
+ clan?: Omit<APIPlayerClan, 'clanLevel'>;
272
270
  league: APILeague;
273
271
  }
274
272
  /** /locations/{locationId}/rankings/clans-versus */
@@ -300,7 +298,7 @@ export interface APIPlayerVersusRanking {
300
298
  versusBattleWins: number;
301
299
  rank: number;
302
300
  previousRank: number;
303
- clan: APIPlayerClan;
301
+ clan?: APIPlayerClan;
304
302
  }
305
303
  /** /leagues */
306
304
  export interface APILeagueList {
@@ -0,0 +1 @@
1
+ { "RAW_UNITS": [{ "id": 0, "name": "Barbarian", "housingSpace": 1, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 1, "cost": 100, "time": 10, "resource": "Elixir", "building": "Barracks", "buildingLevel": 1 }, "upgrade": { "cost": [25000, 100000, 300000, 1000000, 2000000, 3000000, 5000000, 9500000, 15000000], "time": [21600, 43200, 86400, 129600, 216000, 345600, 604800, 1036800, 1209600], "resource": "Elixir" }, "levels": [1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9, 10] }, { "id": 1, "name": "Archer", "housingSpace": 1, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 2, "cost": 500, "time": 60, "resource": "Elixir", "building": "Barracks", "buildingLevel": 2 }, "upgrade": { "cost": [40000, 160000, 480000, 1300000, 2500000, 3500000, 5500000, 10000000, 15500000], "time": [43200, 86400, 129600, 172800, 216000, 345600, 604800, 1036800, 1209600], "resource": "Elixir" }, "levels": [0, 1, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9, 10] }, { "id": 2, "name": "Goblin", "housingSpace": 1, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 2, "cost": 5000, "time": 3600, "resource": "Elixir", "building": "Barracks", "buildingLevel": 4 }, "upgrade": { "cost": [50000, 200000, 600000, 1200000, 2500000, 4000000, 9500000], "time": [43200, 86400, 129600, 172800, 302400, 518400, 1036800], "resource": "Elixir" }, "levels": [0, 1, 2, 2, 3, 3, 4, 5, 6, 7, 7, 8, 8, 8] }, { "id": 3, "name": "Giant", "housingSpace": 5, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 2, "cost": 2500, "time": 600, "resource": "Elixir", "building": "Barracks", "buildingLevel": 3 }, "upgrade": { "cost": [50000, 200000, 600000, 1500000, 2500000, 4000000, 6000000, 10500000, 15000000], "time": [32400, 64800, 129600, 216000, 345600, 432000, 777600, 1209600, 1296000], "resource": "Elixir" }, "levels": [0, 1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10] }, { "id": 4, "name": "Wall Breaker", "housingSpace": 2, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 3, "cost": 10000, "time": 14400, "resource": "Elixir", "building": "Barracks", "buildingLevel": 5 }, "upgrade": { "cost": [100000, 250000, 750000, 1500000, 3500000, 7500000, 11500000, 14000000, 16000000], "time": [43200, 86400, 129600, 172800, 345600, 604800, 950400, 1296000, 1382400], "resource": "Elixir" }, "levels": [0, 0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10] }, { "id": 5, "name": "Balloon", "housingSpace": 5, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 4, "cost": 80000, "time": 28800, "resource": "Elixir", "building": "Barracks", "buildingLevel": 6 }, "upgrade": { "cost": [150000, 450000, 900000, 1800000, 3500000, 7500000, 12000000, 14000000, 18000000], "time": [43200, 86400, 172800, 259200, 345600, 691200, 1209600, 1382400, 1555200], "resource": "Elixir" }, "levels": [0, 0, 0, 2, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10] }, { "id": 6, "name": "Wizard", "housingSpace": 4, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 5, "cost": 240000, "time": 43200, "resource": "Elixir", "building": "Barracks", "buildingLevel": 7 }, "upgrade": { "cost": [150000, 350000, 650000, 1300000, 2600000, 5000000, 8000000, 10000000, 15000000], "time": [43200, 86400, 129600, 172800, 345600, 518400, 777600, 1123200, 1296000], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10] }, { "id": 7, "name": "Healer", "housingSpace": 14, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 6, "cost": 700000, "time": 57600, "resource": "Elixir", "building": "Barracks", "buildingLevel": 8 }, "upgrade": { "cost": [500000, 1000000, 3000000, 9500000, 14500000, 17000000], "time": [129600, 216000, 345600, 1022400, 1296000, 1468800], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 1, 2, 3, 4, 4, 5, 5, 6, 7] }, { "id": 8, "name": "Dragon", "housingSpace": 20, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 7, "cost": 1000000, "time": 86400, "resource": "Elixir", "building": "Barracks", "buildingLevel": 9 }, "upgrade": { "cost": [1750000, 2500000, 4000000, 6000000, 8000000, 10000000, 15000000, 18500000], "time": [129600, 259200, 432000, 604800, 777600, 1209600, 1382400, 1555200], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9] }, { "id": 9, "name": "P.E.K.K.A", "housingSpace": 25, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 8, "cost": 1500000, "time": 129600, "resource": "Elixir", "building": "Barracks", "buildingLevel": 10 }, "upgrade": { "cost": [1500000, 2250000, 3200000, 4500000, 6000000, 9000000, 12000000, 15500000], "time": [172800, 302400, 388800, 518400, 604800, 864000, 1209600, 1296000], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 3, 4, 6, 7, 8, 9, 9] }, { "id": 10, "name": "Minion", "housingSpace": 2, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 7, "cost": 300000, "time": 14400, "resource": "Elixir", "building": "Dark Barracks", "buildingLevel": 1 }, "upgrade": { "cost": [3000, 7000, 15000, 25000, 40000, 90000, 150000, 250000, 300000], "time": [86400, 129600, 172800, 259200, 388800, 604800, 1209600, 1339200, 1425600], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 2, 4, 5, 6, 7, 8, 9, 10] }, { "id": 11, "name": "Hog Rider", "housingSpace": 5, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 7, "cost": 600000, "time": 43200, "resource": "Elixir", "building": "Dark Barracks", "buildingLevel": 2 }, "upgrade": { "cost": [5000, 9000, 16000, 30000, 50000, 100000, 150000, 240000, 280000, 320000], "time": [108000, 172800, 216000, 345600, 432000, 648000, 993600, 1209600, 1382400, 1468800], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 2, 4, 5, 6, 7, 9, 10, 11] }, { "id": 12, "name": "Valkyrie", "housingSpace": 8, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 8, "cost": 900000, "time": 64800, "resource": "Elixir", "building": "Dark Barracks", "buildingLevel": 3 }, "upgrade": { "cost": [8000, 12000, 25000, 45000, 90000, 175000, 260000, 310000], "time": [194400, 259200, 345600, 518400, 734400, 1123200, 1382400, 1468800], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 2, 4, 5, 6, 7, 8, 9] }, { "id": 13, "name": "Golem", "housingSpace": 30, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 8, "cost": 1300000, "time": 86400, "resource": "Elixir", "building": "Dark Barracks", "buildingLevel": 4 }, "upgrade": { "cost": [10000, 20000, 30000, 50000, 75000, 110000, 160000, 200000, 270000, 320000], "time": [216000, 259200, 345600, 432000, 604800, 691200, 907200, 1209600, 1382400, 1468800], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 2, 4, 5, 7, 9, 10, 11] }, { "id": 15, "name": "Witch", "housingSpace": 12, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 9, "cost": 2000000, "time": 172800, "resource": "Elixir", "building": "Dark Barracks", "buildingLevel": 5 }, "upgrade": { "cost": [50000, 80000, 130000, 200000], "time": [432000, 561600, 820800, 1209600], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 5, 5] }, { "id": 17, "name": "Lava Hound", "housingSpace": 30, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 9, "cost": 2500000, "time": 259200, "resource": "Elixir", "building": "Dark Barracks", "buildingLevel": 6 }, "upgrade": { "cost": [35000, 60000, 120000, 190000, 270000], "time": [216000, 432000, 777600, 1209600, 1382400], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 6] }, { "id": 22, "name": "Bowler", "housingSpace": 6, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 10, "cost": 3000000, "time": 432000, "resource": "Elixir", "building": "Dark Barracks", "buildingLevel": 7 }, "upgrade": { "cost": [75000, 125000, 200000, 280000, 320000], "time": [518400, 777600, 1209600, 1382400, 1512000], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6] }, { "id": 23, "name": "Baby Dragon", "housingSpace": 10, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 9, "cost": 2000000, "time": 216000, "resource": "Elixir", "building": "Barracks", "buildingLevel": 11 }, "upgrade": { "cost": [2500000, 3500000, 4500000, 7000000, 9000000, 15000000, 17000000], "time": [259200, 432000, 604800, 777600, 1036800, 1339200, 1425600], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 5, 6, 7, 8] }, { "id": 24, "name": "Miner", "housingSpace": 6, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 10, "cost": 3000000, "time": 345600, "resource": "Elixir", "building": "Barracks", "buildingLevel": 12 }, "upgrade": { "cost": [3500000, 4500000, 6000000, 8000000, 10500000, 14000000, 17500000], "time": [259200, 432000, 648000, 907200, 1209600, 1339200, 1468800], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 6, 7, 8] }, { "id": 30, "name": "Ice Wizard", "housingSpace": 4, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 5, "cost": 240000, "time": 43200, "resource": "Elixir", "building": "Barracks", "buildingLevel": 7 }, "upgrade": { "cost": [150000, 450000, 1350000, 2500000, 5000000, 7000000, 9000000, 11000000, 15000000], "time": [43200, 129600, 172800, 259200, 432000, 518400, 864000, 1209600, 1296000], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10] }, { "id": 31, "name": "Raged Barbarian", "housingSpace": 2, "village": "builderBase", "category": "troop", "subCategory": "troop", "unlock": { "hall": 1, "cost": 1000, "time": 0, "resource": "Builder Elixir", "building": "Builder Barracks", "buildingLevel": 1 }, "upgrade": { "cost": [3500, 6000, 9000, 50000, 100000, 300000, 330000, 700000, 900000, 1000000, 1200000, 2000000, 2200000, 3000000, 3200000, 3800000, 4000000], "time": [0, 300, 900, 10800, 21600, 43200, 43200, 86400, 86400, 172800, 172800, 259200, 259200, 345600, 345600, 432000, 432000], "resource": "Builder Elixir" }, "levels": [2, 4, 6, 8, 10, 12, 14, 16, 18] }, { "id": 32, "name": "Sneaky Archer", "housingSpace": 2, "village": "builderBase", "category": "troop", "subCategory": "troop", "unlock": { "hall": 2, "cost": 4000, "time": 60, "resource": "Builder Elixir", "building": "Builder Barracks", "buildingLevel": 2 }, "upgrade": { "cost": [5000, 8000, 12000, 60000, 120000, 320000, 350000, 800000, 1000000, 1100000, 1300000, 2100000, 2300000, 3100000, 3300000, 3900000, 4100000], "time": [180, 600, 1800, 14400, 21600, 43200, 43200, 86400, 86400, 172800, 172800, 259200, 259200, 345600, 345600, 432000, 432000], "resource": "Builder Elixir" }, "levels": [0, 4, 6, 8, 10, 12, 14, 16, 18] }, { "id": 33, "name": "Beta Minion", "housingSpace": 2, "village": "builderBase", "category": "troop", "subCategory": "troop", "unlock": { "hall": 3, "cost": 25000, "time": 1800, "resource": "Builder Elixir", "building": "Builder Barracks", "buildingLevel": 4 }, "upgrade": { "cost": [50000, 80000, 120000, 250000, 280000, 320000, 360000, 900000, 1100000, 1300000, 1500000, 2300000, 2500000, 3300000, 3500000, 4000000, 4200000], "time": [3600, 10800, 18000, 28800, 43200, 43200, 43200, 86400, 86400, 172800, 172800, 259200, 259200, 345600, 345600, 432000, 432000], "resource": "Builder Elixir" }, "levels": [0, 0, 4, 8, 10, 12, 14, 16, 18] }, { "id": 34, "name": "Boxer Giant", "housingSpace": 8, "village": "builderBase", "category": "troop", "subCategory": "troop", "unlock": { "hall": 3, "cost": 10000, "time": 600, "resource": "Builder Elixir", "building": "Builder Barracks", "buildingLevel": 3 }, "upgrade": { "cost": [20000, 40000, 60000, 300000, 320000, 340000, 380000, 1000000, 1200000, 1300000, 1500000, 2300000, 2500000, 3300000, 3500000, 4000000, 4200000], "time": [1800, 3600, 7200, 28800, 43200, 43200, 43200, 86400, 86400, 172800, 172800, 259200, 259200, 345600, 345600, 432000, 432000], "resource": "Builder Elixir" }, "levels": [0, 0, 4, 8, 10, 12, 14, 16, 18] }, { "id": 35, "name": "Bomber", "housingSpace": 4, "village": "builderBase", "category": "troop", "subCategory": "troop", "unlock": { "hall": 4, "cost": 100000, "time": 10800, "resource": "Builder Elixir", "building": "Builder Barracks", "buildingLevel": 5 }, "upgrade": { "cost": [150000, 200000, 250000, 280000, 320000, 340000, 360000, 900000, 1000000, 1200000, 1400000, 2200000, 2400000, 3200000, 3400000, 3900000, 4100000], "time": [10800, 18000, 28800, 43200, 43200, 43200, 43200, 86400, 86400, 172800, 172800, 259200, 259200, 345600, 345600, 432000, 432000], "resource": "Builder Elixir" }, "levels": [0, 0, 0, 8, 10, 12, 14, 16, 18] }, { "id": 36, "name": "Super P.E.K.K.A", "housingSpace": 25, "village": "builderBase", "category": "troop", "subCategory": "troop", "unlock": { "hall": 8, "cost": 1500000, "time": 86400, "resource": "Builder Elixir", "building": "Builder Barracks", "buildingLevel": 10 }, "upgrade": { "cost": [1600000, 1700000, 1800000, 1900000, 2000000, 2200000, 2400000, 2600000, 2800000, 3000000, 3200000, 3400000, 3600000, 3800000, 4000000, 4600000, 4800000], "time": [86400, 86400, 172800, 172800, 259200, 259200, 345600, 345600, 345600, 345600, 345600, 345600, 345600, 345600, 345600, 432000, 432000], "resource": "Builder Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 16, 18] }, { "id": 37, "name": "Cannon Cart", "housingSpace": 8, "village": "builderBase", "category": "troop", "subCategory": "troop", "unlock": { "hall": 5, "cost": 300000, "time": 28800, "resource": "Builder Elixir", "building": "Builder Barracks", "buildingLevel": 7 }, "upgrade": { "cost": [400000, 500000, 600000, 700000, 800000, 900000, 1000000, 1100000, 1200000, 1400000, 1600000, 2400000, 2600000, 3400000, 3600000, 4100000, 4300000], "time": [43200, 43200, 86400, 86400, 86400, 86400, 86400, 86400, 86400, 172800, 172800, 259200, 259200, 345600, 345600, 432000, 432000], "resource": "Builder Elixir" }, "levels": [0, 0, 0, 0, 10, 12, 14, 16, 18] }, { "id": 38, "name": "Drop Ship", "housingSpace": 5, "village": "builderBase", "category": "troop", "subCategory": "troop", "unlock": { "hall": 7, "cost": 1000000, "time": 43200, "resource": "Builder Elixir", "building": "Builder Barracks", "buildingLevel": 9 }, "upgrade": { "cost": [1100000, 1200000, 1300000, 1400000, 1500000, 1600000, 1700000, 1800000, 2000000, 2200000, 2400000, 2600000, 2800000, 3600000, 3800000, 4300000, 4500000], "time": [43200, 43200, 86400, 86400, 172800, 172800, 259200, 259200, 259200, 259200, 259200, 259200, 259200, 345600, 345600, 432000, 432000], "resource": "Builder Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 14, 16, 18] }, { "id": 41, "name": "Baby Dragon", "housingSpace": 10, "village": "builderBase", "category": "troop", "subCategory": "troop", "unlock": { "hall": 4, "cost": 150000, "time": 21600, "resource": "Builder Elixir", "building": "Builder Barracks", "buildingLevel": 6 }, "upgrade": { "cost": [200000, 240000, 280000, 320000, 360000, 380000, 400000, 1000000, 1200000, 1400000, 1600000, 2400000, 2600000, 3400000, 3600000, 4100000, 4300000], "time": [18000, 28800, 43200, 43200, 43200, 43200, 43200, 86400, 86400, 172800, 172800, 259200, 259200, 345600, 345600, 432000, 432000], "resource": "Builder Elixir" }, "levels": [0, 0, 0, 8, 10, 12, 14, 16, 18] }, { "id": 42, "name": "Night Witch", "housingSpace": 12, "village": "builderBase", "category": "troop", "subCategory": "troop", "unlock": { "hall": 6, "cost": 500000, "time": 36000, "resource": "Builder Elixir", "building": "Builder Barracks", "buildingLevel": 8 }, "upgrade": { "cost": [600000, 700000, 800000, 900000, 1000000, 1100000, 1200000, 1300000, 1400000, 1600000, 1800000, 2500000, 2700000, 3500000, 3700000, 4200000, 4400000], "time": [43200, 43200, 86400, 86400, 172800, 172800, 172800, 172800, 172800, 172800, 172800, 259200, 259200, 345600, 345600, 432000, 432000], "resource": "Builder Elixir" }, "levels": [0, 0, 0, 0, 0, 12, 14, 16, 18] }, { "id": 45, "name": "Battle Ram", "housingSpace": 4, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 2, "cost": 2500, "time": 600, "resource": "Elixir", "building": "Barracks", "buildingLevel": 3 }, "upgrade": { "cost": [100000], "time": [86400], "resource": "Elixir" }, "levels": [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] }, { "id": 47, "name": "Royal Ghost", "housingSpace": 8, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 5, "cost": 240000, "time": 43200, "resource": "Elixir", "building": "Barracks", "buildingLevel": 7 }, "upgrade": { "cost": [5000], "time": [86400], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 1, 2, 2, 3, 4, 5, 6, 7, 7, 7] }, { "id": 48, "name": "Pumpkin Barbarian", "housingSpace": 1, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 1, "cost": 100, "time": 10, "resource": "Elixir", "building": "Barracks", "buildingLevel": 1 }, "upgrade": { "cost": [50000, 150000, 500000, 1500000, 4500000, 6000000], "time": [21600, 86400, 259200, 432000, 864000, 1209600], "resource": "Elixir" }, "levels": [1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 7, 7, 7, 7] }, { "id": 50, "name": "Giant Skeleton", "housingSpace": 20, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 2, "cost": 2500, "time": 600, "resource": "Elixir", "building": "Barracks", "buildingLevel": 3 }, "upgrade": { "cost": [100000, 250000, 750000, 2250000, 5000000, 6000000, 9500000], "time": [86400, 172800, 259200, 432000, 864000, 1036800, 1209600], "resource": "Elixir" }, "levels": [0, 1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8] }, { "id": 51, "name": "Wall Wrecker", "housingSpace": 1, "village": "home", "category": "troop", "subCategory": "siege", "unlock": { "hall": 12, "cost": 7500000, "time": 518400, "resource": "Elixir", "building": "Workshop", "buildingLevel": 1 }, "upgrade": { "cost": [6000000, 8000000, 14000000], "time": [691200, 864000, 1382400], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 4] }, { "id": 52, "name": "Battle Blimp", "housingSpace": 1, "village": "home", "category": "troop", "subCategory": "siege", "unlock": { "hall": 12, "cost": 9000000, "time": 691200, "resource": "Elixir", "building": "Workshop", "buildingLevel": 2 }, "upgrade": { "cost": [6000000, 8000000, 14000000], "time": [691200, 864000, 1382400], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 4] }, { "id": 53, "name": "Yeti", "housingSpace": 18, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 12, "cost": 5000000, "time": 777600, "resource": "Elixir", "building": "Barracks", "buildingLevel": 14 }, "upgrade": { "cost": [11000000, 15000000, 18000000], "time": [1209600, 1382400, 1555200], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4] }, { "id": 58, "name": "Ice Golem", "housingSpace": 15, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 11, "cost": 4000000, "time": 777600, "resource": "Elixir", "building": "Dark Barracks", "buildingLevel": 8 }, "upgrade": { "cost": [80000, 120000, 160000, 200000, 320000], "time": [432000, 691200, 907200, 1209600, 1468800], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 5, 6] }, { "id": 59, "name": "Electro Dragon", "housingSpace": 30, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 11, "cost": 4000000, "time": 518400, "resource": "Elixir", "building": "Barracks", "buildingLevel": 13 }, "upgrade": { "cost": [9000000, 11000000, 16000000, 19000000], "time": [864000, 1209600, 1382400, 1555200], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5] }, { "id": 61, "name": "Skeleton Barrel", "housingSpace": 5, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 4, "cost": 80000, "time": 28800, "resource": "Elixir", "building": "Barracks", "buildingLevel": 6 }, "upgrade": { "cost": [150000, 450000, 1350000, 2500000, 6000000, 9500000, 12000000, 12000000], "time": [43200, 129600, 172800, 302400, 561600, 993600, 1209600, 1209600], "resource": "Elixir" }, "levels": [0, 0, 0, 2, 2, 3, 4, 5, 6, 6, 7, 8, 9, 9] }, { "id": 62, "name": "Stone Slammer", "housingSpace": 1, "village": "home", "category": "troop", "subCategory": "siege", "unlock": { "hall": 12, "cost": 10500000, "time": 864000, "resource": "Elixir", "building": "Workshop", "buildingLevel": 3 }, "upgrade": { "cost": [6000000, 8000000, 14000000], "time": [691200, 864000, 1382400], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 4] }, { "id": 65, "name": "Dragon Rider", "housingSpace": 25, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 13, "cost": 6000000, "time": 950400, "resource": "Elixir", "building": "Barracks", "buildingLevel": 15 }, "upgrade": { "cost": [16000000, 17500000], "time": [1296000, 1468800], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3] }, { "id": 67, "name": "El Primo", "housingSpace": 10, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 5, "cost": 240000, "time": 43200, "resource": "Elixir", "building": "Barracks", "buildingLevel": 7 }, "upgrade": { "cost": [120000], "time": [734400], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] }, { "id": 70, "name": "Hog Glider", "housingSpace": 5, "village": "builderBase", "category": "troop", "subCategory": "troop", "unlock": { "hall": 9, "cost": 2000000, "time": 129600, "resource": "Builder Elixir", "building": "Builder Barracks", "buildingLevel": 11 }, "upgrade": { "cost": [1600000, 1700000, 1800000, 1900000, 2000000, 2200000, 2400000, 2600000, 2800000, 3000000, 3200000, 3400000, 3600000, 3800000, 4000000, 4200000, 4400000], "time": [86400, 86400, 172800, 172800, 259200, 259200, 345600, 345600, 345600, 345600, 345600, 345600, 345600, 345600, 345600, 432000, 432000], "resource": "Builder Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 18] }, { "id": 72, "name": "Party Wizard", "housingSpace": 4, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 5, "cost": 240000, "time": 43200, "resource": "Elixir", "building": "Barracks", "buildingLevel": 7 }, "upgrade": { "cost": [null], "time": [0], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10] }, { "id": 75, "name": "Siege Barracks", "housingSpace": 1, "village": "home", "category": "troop", "subCategory": "siege", "unlock": { "hall": 13, "cost": 14500000, "time": 1209600, "resource": "Elixir", "building": "Workshop", "buildingLevel": 4 }, "upgrade": { "cost": [8000000, 11000000, 14000000], "time": [864000, 1209600, 1382400], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4] }, { "id": 82, "name": "Headhunter", "housingSpace": 6, "village": "home", "category": "troop", "subCategory": "troop", "unlock": { "hall": 12, "cost": 7500000, "time": 1123200, "resource": "Elixir", "building": "Dark Barracks", "buildingLevel": 9 }, "upgrade": { "cost": [180000, 240000], "time": [1209600, 1382400], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3] }, { "id": 87, "name": "Log Launcher", "housingSpace": 1, "village": "home", "category": "troop", "subCategory": "siege", "unlock": { "hall": 13, "cost": 16000000, "time": 1382400, "resource": "Elixir", "building": "Workshop", "buildingLevel": 5 }, "upgrade": { "cost": [8000000, 11000000, 14000000], "time": [864000, 1209600, 1382400], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4] }, { "id": 0, "name": "Lightning Spell", "housingSpace": 1, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 5, "cost": 200000, "time": 28800, "resource": "Elixir", "building": "Spell Factory", "buildingLevel": 1 }, "upgrade": { "cost": [85000, 225000, 450000, 900000, 2000000, 4000000, 8000000, 10000000], "time": [43200, 86400, 129600, 259200, 432000, 691200, 907200, 1123200], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 4, 4, 4, 5, 6, 7, 8, 9, 9, 9] }, { "id": 1, "name": "Healing Spell", "housingSpace": 2, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 6, "cost": 400000, "time": 86400, "resource": "Elixir", "building": "Spell Factory", "buildingLevel": 2 }, "upgrade": { "cost": [75000, 300000, 600000, 1200000, 2500000, 4500000, 14000000], "time": [21600, 64800, 129600, 259200, 432000, 777600, 1382400], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 3, 4, 5, 6, 7, 7, 7, 8, 8] }, { "id": 2, "name": "Rage Spell", "housingSpace": 2, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 7, "cost": 800000, "time": 172800, "resource": "Elixir", "building": "Spell Factory", "buildingLevel": 3 }, "upgrade": { "cost": [450000, 900000, 1800000, 3000000, 11000000], "time": [64800, 129600, 259200, 432000, 993600], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 4, 5, 5, 5, 5, 6, 6, 6] }, { "id": 3, "name": "Jump Spell", "housingSpace": 2, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 9, "cost": 1200000, "time": 302400, "resource": "Elixir", "building": "Spell Factory", "buildingLevel": 4 }, "upgrade": { "cost": [3000000, 6000000, 13000000], "time": [345600, 604800, 1296000], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4] }, { "id": 5, "name": "Freeze Spell", "housingSpace": 1, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 9, "cost": 1200000, "time": 302400, "resource": "Elixir", "building": "Spell Factory", "buildingLevel": 4 }, "upgrade": { "cost": [1500000, 2500000, 4200000, 6000000, 8500000, 11000000], "time": [172800, 345600, 518400, 648000, 777600, 993600], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 6, 7, 7, 7] }, { "id": 4, "name": "Santa's Surprise", "housingSpace": 2, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 5, "cost": 200000, "time": 28800, "resource": "Elixir", "building": "Spell Factory", "buildingLevel": 1 }, "upgrade": { "cost": [null], "time": [null], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] }, { "id": 9, "name": "Poison Spell", "housingSpace": 1, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 8, "cost": 250000, "time": 21600, "resource": "Elixir", "building": "Dark Spell Factory", "buildingLevel": 1 }, "upgrade": { "cost": [20000, 40000, 75000, 150000, 200000, 260000, 300000], "time": [86400, 172800, 345600, 777600, 950400, 1339200, 1512000], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8] }, { "id": 10, "name": "Earthquake Spell", "housingSpace": 1, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 8, "cost": 500000, "time": 64800, "resource": "Elixir", "building": "Dark Spell Factory", "buildingLevel": 2 }, "upgrade": { "cost": [20000, 40000, 75000, 120000], "time": [172800, 345600, 648000, 950400], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 5, 5, 5] }, { "id": 11, "name": "Haste Spell", "housingSpace": 1, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 9, "cost": 1000000, "time": 172800, "resource": "Elixir", "building": "Dark Spell Factory", "buildingLevel": 3 }, "upgrade": { "cost": [30000, 50000, 80000, 120000], "time": [216000, 432000, 691200, 950400], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 5, 5, 5, 5] }, { "id": 16, "name": "Clone Spell", "housingSpace": 3, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 10, "cost": 2400000, "time": 432000, "resource": "Elixir", "building": "Spell Factory", "buildingLevel": 5 }, "upgrade": { "cost": [3000000, 4500000, 7000000, 9000000, 14000000, 16500000], "time": [259200, 388800, 561600, 993600, 1296000, 1425600], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 5, 6, 7] }, { "id": 17, "name": "Skeleton Spell", "housingSpace": 1, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 9, "cost": 2000000, "time": 345600, "resource": "Elixir", "building": "Dark Spell Factory", "buildingLevel": 4 }, "upgrade": { "cost": [25000, 40000, 70000, 125000, 150000, 250000], "time": [216000, 345600, 561600, 734400, 907200, 1296000], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 4, 6, 7, 7] }, { "id": 22, "name": "Birthday Boom", "housingSpace": 2, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 5, "cost": 200000, "time": 28800, "resource": "Elixir", "building": "Spell Factory", "buildingLevel": 1 }, "upgrade": { "cost": [null], "time": [null], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] }, { "id": 28, "name": "Bat Spell", "housingSpace": 1, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 10, "cost": 3000000, "time": 518400, "resource": "Elixir", "building": "Dark Spell Factory", "buildingLevel": 5 }, "upgrade": { "cost": [30000, 60000, 120000, 160000], "time": [259200, 475200, 648000, 777600], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 5, 5] }, { "id": 35, "name": "Invisibility Spell", "housingSpace": 1, "village": "home", "category": "spell", "subCategory": "spell", "unlock": { "hall": 11, "cost": 4800000, "time": 604800, "resource": "Elixir", "building": "Spell Factory", "buildingLevel": 6 }, "upgrade": { "cost": [9000000, 12000000, 15000000], "time": [777600, 993600, 1339200], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 4] }, { "id": 0, "name": "Barbarian King", "housingSpace": 25, "village": "home", "category": "hero", "subCategory": "hero", "unlock": { "hall": 7, "cost": 5000, "time": 0, "resource": "Dark Elixir", "building": "Barbarian King", "buildingLevel": 1 }, "upgrade": { "cost": [6000, 7000, 8000, 10000, 11000, 12000, 13000, 14000, 15000, 17000, 19000, 21000, 23000, 25000, 27000, 29000, 31000, 33000, 35000, 37000, 39000, 41000, 43000, 45000, 48000, 51000, 54000, 57000, 60000, 63000, 66000, 69000, 72000, 75000, 80000, 85000, 90000, 95000, 100000, 105000, 110000, 120000, 130000, 140000, 150000, 160000, 170000, 180000, 190000, 200000, 203000, 206000, 209000, 212000, 215000, 218000, 221000, 224000, 227000, 230000, 233000, 236000, 239000, 240000, 250000, 260000, 270000, 280000, 290000, 292000, 294000, 296000, 298000, 300000, 305000, 310000, 315000, 320000, 325000], "time": [14400, 21600, 28800, 36000, 43200, 50400, 57600, 64800, 72000, 79200, 86400, 115200, 144000, 172800, 172800, 172800, 172800, 172800, 259200, 259200, 259200, 259200, 259200, 302400, 302400, 302400, 302400, 302400, 345600, 345600, 345600, 345600, 345600, 432000, 432000, 432000, 432000, 432000, 518400, 518400, 518400, 518400, 518400, 561600, 561600, 561600, 561600, 561600, 561600, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 648000, 648000, 648000, 648000, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 5, 10, 30, 40, 50, 65, 75, 80] }, { "id": 1, "name": "Archer Queen", "housingSpace": 25, "village": "home", "category": "hero", "subCategory": "hero", "unlock": { "hall": 9, "cost": 10000, "time": 0, "resource": "Dark Elixir", "building": "Archer Queen", "buildingLevel": 1 }, "upgrade": { "cost": [11000, 12000, 13000, 15000, 16000, 17000, 18000, 19000, 20000, 22000, 24000, 26000, 28000, 30000, 32000, 34000, 36000, 38000, 40000, 42000, 44000, 46000, 48000, 50000, 53000, 56000, 59000, 62000, 65000, 68000, 71000, 74000, 77000, 80000, 85000, 90000, 95000, 100000, 105000, 115000, 120000, 125000, 135000, 145000, 155000, 165000, 175000, 185000, 195000, 200000, 204000, 208000, 212000, 216000, 220000, 224000, 228000, 232000, 236000, 240000, 240000, 240000, 240000, 240000, 250000, 260000, 270000, 280000, 290000, 292000, 294000, 296000, 298000, 300000, 306000, 312000, 318000, 324000, 330000], "time": [14400, 21600, 28800, 36000, 43200, 50400, 57600, 64800, 72000, 79200, 86400, 115200, 144000, 172800, 172800, 172800, 172800, 172800, 259200, 259200, 259200, 259200, 259200, 302400, 302400, 302400, 302400, 302400, 345600, 345600, 345600, 345600, 345600, 432000, 432000, 432000, 432000, 432000, 518400, 518400, 518400, 518400, 518400, 561600, 561600, 561600, 561600, 561600, 561600, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 648000, 648000, 648000, 648000, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 30, 40, 50, 65, 75, 80] }, { "id": 2, "name": "Grand Warden", "housingSpace": 25, "village": "home", "category": "hero", "subCategory": "hero", "unlock": { "hall": 11, "cost": 2000000, "time": 0, "resource": "Elixir", "building": "Grand Warden", "buildingLevel": 1 }, "upgrade": { "cost": [2250000, 2500000, 2750000, 3000000, 3300000, 3750000, 4500000, 5250000, 6000000, 7000000, 7500000, 8000000, 8400000, 8800000, 9100000, 9400000, 9600000, 9800000, 10000000, 10000000, 10200000, 10400000, 10600000, 10800000, 11000000, 11200000, 11400000, 11600000, 11800000, 12000000, 12000000, 12000000, 12000000, 12000000, 12000000, 12000000, 12000000, 12000000, 12000000, 12000000, 12500000, 13000000, 13500000, 14000000, 14500000, 15000000, 15500000, 16000000, 16500000, 17000000, 17500000, 18000000, 18500000, 19000000], "time": [14400, 28800, 43200, 86400, 129600, 172800, 259200, 345600, 388800, 432000, 475200, 518400, 561600, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 604800, 648000, 648000, 648000, 648000, 648000, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 40, 50, 55] }, { "id": 3, "name": "Battle Machine", "housingSpace": 25, "village": "builderBase", "category": "hero", "subCategory": "hero", "unlock": { "hall": 5, "cost": 900000, "time": 43200, "resource": "Builder Elixir", "building": "Battle Machine", "buildingLevel": 1 }, "upgrade": { "cost": [1000000, 1100000, 1200000, 1300000, 1500000, 1600000, 1700000, 1800000, 1900000, 2100000, 2200000, 2300000, 2400000, 2500000, 2600000, 2700000, 2800000, 2900000, 3000000, 3100000, 3200000, 3300000, 3400000, 3500000, 3600000, 3700000, 3800000, 3900000, 4000000, 4000000], "time": [43200, 43200, 86400, 86400, 86400, 86400, 86400, 86400, 86400, 172800, 172800, 172800, 172800, 172800, 259200, 259200, 259200, 259200, 259200, 259200, 259200, 259200, 259200, 259200, 345600, 345600, 345600, 345600, 345600, 345600], "resource": "Builder Elixir" }, "levels": [0, 0, 0, 0, 5, 10, 20, 25, 30] }, { "id": 4, "name": "Royal Champion", "housingSpace": 25, "village": "home", "category": "hero", "subCategory": "hero", "unlock": { "hall": 13, "cost": 120000, "time": 0, "resource": "Dark Elixir", "building": "Royal Champion", "buildingLevel": 1 }, "upgrade": { "cost": [130000, 140000, 150000, 160000, 170000, 180000, 190000, 200000, 210000, 220000, 230000, 235000, 240000, 245000, 250000, 255000, 260000, 265000, 270000, 275000, 280000, 285000, 290000, 295000, 300000, 305000, 310000, 315000, 320000], "time": [86400, 129600, 172800, 216000, 259200, 302400, 345600, 388800, 432000, 475200, 518400, 561600, 604800, 604800, 648000, 648000, 648000, 648000, 648000, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200, 691200], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 30] }, { "id": 0, "name": "L.A.S.S.I", "housingSpace": 20, "village": "home", "category": "troop", "subCategory": "pet", "unlock": { "hall": 14, "cost": 15000000, "time": 1123200, "resource": "Elixir", "building": "Pet House", "buildingLevel": 1 }, "upgrade": { "cost": [115000, 130000, 145000, 160000, 175000, 190000, 205000, 220000, 235000], "time": [259200, 345600, 432000, 475200, 518400, 561600, 604800, 648000, 691200], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10] }, { "id": 1, "name": "Mighty Yak", "housingSpace": 20, "village": "home", "category": "troop", "subCategory": "pet", "unlock": { "hall": 14, "cost": 18500000, "time": 1468800, "resource": "Elixir", "building": "Pet House", "buildingLevel": 3 }, "upgrade": { "cost": [165000, 185000, 205000, 225000, 245000, 255000, 265000, 275000, 285000], "time": [259200, 345600, 432000, 475200, 518400, 561600, 604800, 648000, 691200], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10] }, { "id": 2, "name": "Electro Owl", "housingSpace": 20, "village": "home", "category": "troop", "subCategory": "pet", "unlock": { "hall": 14, "cost": 17500000, "time": 1296000, "resource": "Elixir", "building": "Pet House", "buildingLevel": 2 }, "upgrade": { "cost": [135000, 150000, 165000, 180000, 195000, 210000, 225000, 240000, 255000], "time": [259200, 345600, 432000, 475200, 518400, 561600, 604800, 648000, 691200], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10] }, { "id": 3, "name": "Unicorn", "housingSpace": 20, "village": "home", "category": "troop", "subCategory": "pet", "unlock": { "hall": 14, "cost": 19500000, "time": 1641600, "resource": "Elixir", "building": "Pet House", "buildingLevel": 4 }, "upgrade": { "cost": [210000, 220000, 230000, 240000, 250000, 260000, 270000, 280000, 290000], "time": [259200, 345600, 432000, 475200, 518400, 561600, 604800, 648000, 691200], "resource": "Dark Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10] }, { "id": 4, "name": "", "housingSpace": 20, "village": "home", "category": "troop", "subCategory": "pet", "unlock": { "hall": 14, "cost": 15000000, "time": 1123200, "resource": "Elixir", "building": "Pet House", "buildingLevel": 1 }, "upgrade": { "cost": [4000000], "time": [432000], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] }, { "id": 4, "name": "", "housingSpace": 20, "village": "home", "category": "troop", "subCategory": "pet", "unlock": { "hall": 14, "cost": 15000000, "time": 1123200, "resource": "Elixir", "building": "Pet House", "buildingLevel": 1 }, "upgrade": { "cost": [750000], "time": [172800], "resource": "Elixir" }, "levels": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] }], "RAW_SUPER_UNITS": [{ "name": "Super Barbarian", "id": 26, "original": "Barbarian", "minOriginalLevel": 8, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 5 }, { "name": "Sneaky Goblin", "id": 55, "original": "Goblin", "minOriginalLevel": 7, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 3 }, { "name": "Super Giant", "id": 29, "original": "Giant", "minOriginalLevel": 9, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 10 }, { "name": "Super Wall Breaker", "id": 28, "original": "Wall Breaker", "minOriginalLevel": 7, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 8 }, { "name": "Super Archer", "id": 27, "original": "Archer", "minOriginalLevel": 8, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 12 }, { "name": "Super Witch", "id": 66, "original": "Witch", "minOriginalLevel": 5, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 40 }, { "name": "Inferno Dragon", "id": 63, "original": "Baby Dragon", "minOriginalLevel": 6, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 15 }, { "name": "Super Valkyrie", "id": 64, "original": "Valkyrie", "minOriginalLevel": 7, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 20 }, { "name": "Super Minion", "id": 84, "original": "Minion", "minOriginalLevel": 8, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 12 }, { "name": "Super Wizard", "id": 83, "original": "Wizard", "minOriginalLevel": 9, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 10 }, { "name": "Ice Hound", "id": 76, "original": "Lava Hound", "minOriginalLevel": 5, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 40 }, { "name": "Rocket Balloon", "id": 57, "original": "Balloon", "minOriginalLevel": 8, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 8 }, { "name": "Super Bowler", "id": 80, "original": "Bowler", "minOriginalLevel": 4, "village": "home", "duration": 259200, "cooldown": 259200, "resource": "Dark Elixir", "resourceCost": 25000, "housingSpace": 30 }] }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clashofclans.js",
3
- "version": "2.0.0-dev.dedb83d",
3
+ "version": "2.0.1-dev.ba82327",
4
4
  "description": "JavaScript library for interacting with the Clash of Clans API",
5
5
  "author": "SUVAJIT <suvajit.me@gmail.com>",
6
6
  "license": "MIT",