Skip to content

Commit

Permalink
chore: TH15 changes (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
r-priyam committed Oct 26, 2022
1 parent debc937 commit 77903f2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clashofclans.js",
"version": "2.9.0",
"version": "2.9.1",
"description": "JavaScript library for interacting with the Clash of Clans API",
"author": "SUVAJIT <suvajit.me@gmail.com>",
"license": "MIT",
Expand Down
5 changes: 0 additions & 5 deletions src/struct/Unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ export class Unit {
/** Damage per second of this unit. */
public dps!: number;

/** Resource type of this unit. */
public resourceType!: string;

/** Training time of this unit. */
public trainingTime!: number;

Expand Down Expand Up @@ -104,7 +101,6 @@ export class Unit {
this.unlockBuildingLevel = original.unlock.buildingLevel;

this.dps = rawUnit!.dps[this.level - 1];
this.resourceType = rawSuperUnit.resource;
this.trainingTime = rawUnit!.trainingTime;

const origin = data.troops.find((troop) => troop.village === 'home' && troop.name === original.name)!;
Expand All @@ -129,7 +125,6 @@ export class Unit {
this.upgradeCost = rawUnit.upgrade.cost[this.level - 1] ?? 0;
this.upgradeTime = rawUnit.upgrade.time[this.level - 1] ?? 0;
this.dps = rawUnit.dps[this.level - 1];
this.resourceType = rawUnit.resourceType;
this.trainingTime = rawUnit.trainingTime;
if (rawUnit.category === 'hero') this.regenerationTime = rawUnit.regenerationTimes[this.level - 1];
this.hallMaxLevel = rawUnit.levels[(this.village === 'home' ? data.townHallLevel : data.builderHallLevel!) - 1];
Expand Down
16 changes: 13 additions & 3 deletions src/util/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,23 @@ export const ELIXIR_TROOPS = [
'Miner',
'Electro Dragon',
'Yeti',
'Dragon Rider'
'Dragon Rider',
'Electro Titan'
];

export const DARK_ELIXIR_TROOPS = ['Minion', 'Hog Rider', 'Valkyrie', 'Golem', 'Witch', 'Lava Hound', 'Bowler', 'Ice Golem', 'Headhunter'];

export const HOME_TROOPS = [...ELIXIR_TROOPS, ...DARK_ELIXIR_TROOPS];

export const SIEGE_MACHINES = ['Wall Wrecker', 'Battle Blimp', 'Stone Slammer', 'Siege Barracks', 'Log Launcher', 'Flame Flinger'];
export const SIEGE_MACHINES = [
'Wall Wrecker',
'Battle Blimp',
'Stone Slammer',
'Siege Barracks',
'Log Launcher',
'Flame Flinger',
'Battle Drill'
];

export const SUPER_TROOPS = [
'Super Barbarian',
Expand All @@ -51,7 +60,8 @@ export const ELIXIR_SPELLS = [
'Jump Spell',
'Freeze Spell',
'Clone Spell',
'Invisibility Spell'
'Invisibility Spell',
'Recall Spell'
];

export const DARK_ELIXIR_SPELLS = ['Poison Spell', 'Earthquake Spell', 'Haste Spell', 'Skeleton Spell', 'Bat Spell'];
Expand Down
2 changes: 1 addition & 1 deletion src/util/raw.json

Large diffs are not rendered by default.

1 comment on commit 77903f2

@csuvajit
Copy link
Contributor

@csuvajit csuvajit commented on 77903f2 Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for clashofclans-js ready!

✅ Preview
https://clashofclans-2q70r83ld-csuvajit.vercel.app

Built with commit 77903f2.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.