Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moves building upgrades from units to buildings #61

Merged
merged 1 commit into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/output.json
Original file line number Diff line number Diff line change
Expand Up @@ -903,5 +903,5 @@
"randomRaces": false,
"speed": 2
},
"parseTime": 136
"parseTime": 145
}
31 changes: 13 additions & 18 deletions src/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,6 @@ const units: { [key: string]: string } = {
hgyr: "u_Flying Machine",
hspt: "u_Spell Breaker",
hdhw: "u_Dragonhawk Rider",
// building upgrades
hkee: "b_Keep",
hcas: "b_Castle",
hctw: "b_Cannon Tower",
hgtw: "b_Guard Tower",
hatw: "b_Arcane Tower",
ebal: "u_Glaive Thrower",
echm: "u_Chimaera",
edoc: "u_Druid of the Claw",
Expand All @@ -271,9 +265,6 @@ const units: { [key: string]: string } = {
ehip: "u_Hippogryph",
emtg: "u_Mountain Giant",
efdr: "u_Faerie Dragon",
// building upgrades
etoa: "b_Tree of Ages",
etoe: "b_Tree of Eternity",
ocat: "u_Demolisher",
odoc: "u_Troll Witch Doctor",
ogru: "u_Grunt",
Expand All @@ -288,9 +279,6 @@ const units: { [key: string]: string } = {
ospw: "u_Spirit Walker",
ospm: "u_Spirit Walker",
otbr: "u_Troll Batrider",
// building upgrades
ofrt: "b_Fortress",
ostr: "b_Stronghold",
uaco: "u_Acolyte",
uabo: "u_Abomination",
uban: "u_Banshee",
Expand All @@ -303,12 +291,6 @@ const units: { [key: string]: string } = {
ushd: "u_Shade",
uobs: "u_Obsidian Statue",
ubsp: "u_Destroyer",
// building upgrades
unp1: "b_Halls of the Dead",
unp2: "b_Black Citadel",
uzg1: "b_Spirit Tower",
uzg2: "b_Nerubian Tower",

nskm: "u_Skeletal Marksman",
nskf: "u_Burning Archer",
nws1: "u_Dragon Hawk",
Expand Down Expand Up @@ -415,6 +397,11 @@ const buildings: { [key: string]: string } = {
hvlt: "Arcane Vault",
hlum: "Lumber Mill",
htow: "Town Hall",
hkee: "b_Keep",
hcas: "b_Castle",
hctw: "b_Cannon Tower",
hgtw: "b_Guard Tower",
hatw: "b_Arcane Tower",
etrp: "Ancient Protector",
etol: "Tree of Life",
edob: "Hunter's Hall",
Expand All @@ -425,6 +412,8 @@ const buildings: { [key: string]: string } = {
eaow: "Ancient of Wind",
edos: "Chimaera Roost",
emow: "Moon Well",
etoa: "b_Tree of Ages",
etoe: "b_Tree of Eternity",
oalt: "Altar of Storms",
obar: "Barracks",
obea: "Beastiary",
Expand All @@ -436,6 +425,8 @@ const buildings: { [key: string]: string } = {
otto: "Tauren Totem",
ovln: "Voodoo Lounge",
owtw: "Watch Tower",
ofrt: "b_Fortress",
ostr: "b_Stronghold",
uaod: "Altar of Darkness",
unpl: "Necropolis",
usep: "Crypt",
Expand All @@ -447,6 +438,10 @@ const buildings: { [key: string]: string } = {
usap: "Sacrificial Pit",
uslh: "Slaughterhouse",
ugrv: "Graveyard",
unp1: "b_Halls of the Dead",
unp2: "b_Black Citadel",
uzg1: "b_Spirit Tower",
uzg2: "b_Nerubian Tower",
};

const upgrades: { [key: string]: string } = {
Expand Down
2 changes: 0 additions & 2 deletions test/replays/129/replays.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ it("parses a standard 1.29 replay with observers properly", async () => {
expect(test.players[1].units.summary).toEqual({
opeo: 10,
ogru: 5,
ostr: 1,
orai: 6,
ospm: 5,
okod: 2,
Expand Down Expand Up @@ -63,7 +62,6 @@ it("parses a standard 1.29 replay with observers properly", async () => {
expect(test.players[0].units.summary).toEqual({
opeo: 11,
ogru: 8,
ostr: 2,
orai: 8,
ospm: 4,
okod: 3,
Expand Down
28 changes: 14 additions & 14 deletions test/replays/130/__snapshots__/replays.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ Object {
"id": "hhou",
"ms": 122755,
},
Object {
"id": "hkee",
"ms": 190494,
},
Object {
"id": "hhou",
"ms": 210930,
Expand All @@ -71,6 +75,10 @@ Object {
"id": "hwtw",
"ms": 216711,
},
Object {
"id": "hatw",
"ms": 248942,
},
Object {
"id": "hhou",
"ms": 253012,
Expand Down Expand Up @@ -103,16 +111,22 @@ Object {
"id": "hhou",
"ms": 673657,
},
Object {
"id": "hatw",
"ms": 933869,
},
Object {
"id": "htow",
"ms": 1065471,
},
],
"summary": Object {
"halt": 1,
"hatw": 2,
"hbar": 1,
"hbla": 1,
"hhou": 9,
"hkee": 1,
"hlum": 1,
"htow": 2,
"hvlt": 1,
Expand Down Expand Up @@ -329,18 +343,10 @@ Object {
"id": "hrif",
"ms": 160527,
},
Object {
"id": "hkee",
"ms": 190494,
},
Object {
"id": "hrif",
"ms": 202902,
},
Object {
"id": "hatw",
"ms": 248942,
},
Object {
"id": "hrif",
"ms": 250426,
Expand Down Expand Up @@ -497,10 +503,6 @@ Object {
"id": "hrif",
"ms": 916553,
},
Object {
"id": "hatw",
"ms": 933869,
},
Object {
"id": "hrif",
"ms": 959420,
Expand Down Expand Up @@ -531,8 +533,6 @@ Object {
},
],
"summary": Object {
"hatw": 2,
"hkee": 1,
"hpea": 20,
"hrif": 38,
},
Expand Down