Skip to content

Commit 89d6a1e

Browse files
committed
Add AoM Gods as draft options
1 parent 11d74b7 commit 89d6a1e

18 files changed

+124
-0
lines changed
42.7 KB
Loading
49.3 KB
Loading
43.2 KB
Loading
35.1 KB
Loading
47.9 KB
Loading
45.3 KB
Loading
45.5 KB
Loading
42.4 KB
Loading
53.6 KB
Loading

public/images/aomgods/aomgods.ra.png

36.2 KB
Loading

public/images/aomgods/aomgods.set.png

38.5 KB
Loading
39.7 KB
Loading
43.1 KB
Loading

src/components/PresetEditor/PresetEditor.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import CivilisationSet from "../../models/CivilisationSet";
3636
import Aoe2Map from "../../models/Aoe2Map";
3737
import Aoe1Civilisation from "../../models/Aoe1Civilisation";
3838
import Aoe4Map from "../../models/Aoe4Map";
39+
import AomGod from "../../models/AomGod";
3940

4041
interface Props extends WithTranslation, RouteComponentProps<any> {
4142
preset: Preset | null,
@@ -84,6 +85,9 @@ class PresetEditor extends React.Component<Props, State> {
8485
case CivilisationSet.AOE4MAPS:
8586
this.setState({defaultDraftOptions: Aoe4Map.ALL, activeCivilisationSet: CivilisationSet.AOE4MAPS});
8687
break;
88+
case CivilisationSet.AOMGODS:
89+
this.setState({defaultDraftOptions: AomGod.ALL, activeCivilisationSet: CivilisationSet.AOMGODS});
90+
break;
8791
case CivilisationSet.CUSTOM:
8892
this.setState({defaultDraftOptions: [], activeCivilisationSet: CivilisationSet.CUSTOM});
8993
break;
@@ -110,6 +114,9 @@ class PresetEditor extends React.Component<Props, State> {
110114
case CivilisationSet.AOE4MAPS:
111115
this.props.onPresetDraftOptionsChange([]);
112116
break;
117+
case CivilisationSet.AOMGODS:
118+
this.props.onPresetDraftOptionsChange([...AomGod.ALL]);
119+
break;
113120
case CivilisationSet.CUSTOM:
114121
this.configureSampleDraftOption();
115122
break;
@@ -139,6 +146,8 @@ class PresetEditor extends React.Component<Props, State> {
139146
return CivilisationSet.AOE4;
140147
} else if (draftOptions.every(draftOption => Aoe4Map.ALL.some(aoe4map => DraftOption.equals(draftOption, aoe4map)))) {
141148
return CivilisationSet.AOE4MAPS;
149+
} else if (draftOptions.every(draftOption => AomGod.ALL.some(aomgod => DraftOption.equals(draftOption, aomgod)))) {
150+
return CivilisationSet.AOMGODS;
142151
} else {
143152
return CivilisationSet.CUSTOM;
144153
}
@@ -248,6 +257,17 @@ class PresetEditor extends React.Component<Props, State> {
248257
<Trans i18nKey="presetEditor.aoe4Maps">AoE4 Maps</Trans>
249258
</a>
250259
</li>
260+
<li className={this.state.activeCivilisationSet === CivilisationSet.AOMGODS ? "is-active" : ""}>
261+
<a href="#aomgods" onClick={() => {
262+
this.setState({
263+
defaultDraftOptions: AomGod.ALL,
264+
activeCivilisationSet: CivilisationSet.AOMGODS
265+
});
266+
this.props.onPresetDraftOptionsChange([...AomGod.ALL]);
267+
}}>
268+
<Trans i18nKey="presetEditor.aomgods">AoM Gods</Trans>
269+
</a>
270+
</li>
251271
<li className={this.state.activeCivilisationSet === CivilisationSet.CUSTOM ? "is-active" : ""}>
252272
<a href="#custom" onClick={() => {
253273
this.setState({

src/languages/de_DE.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,21 @@
111111
"ZhuXiLegacy": "Vermächtnis von Zhu Xi",
112112
"JeanneDArc": "Johanna von Orléans",
113113
"OrderOfTheDragon": "Orden des Drachen"
114+
},
115+
"aomgods": {
116+
"Zeus": "Zeus",
117+
"Poseidon": "Poseidon",
118+
"Hades": "Hades",
119+
"Ra": "Ra",
120+
"Isis": "Isis",
121+
"Set": "Set",
122+
"Odin": "Odin",
123+
"Thor": "Thor",
124+
"Loki": "Loki",
125+
"Freyr": "Freyr",
126+
"Kronos": "Kronos",
127+
"Gaia": "Gaia",
128+
"Oranos": "Oranos"
114129
}
115130
},
116131
"messages": {
@@ -329,6 +344,7 @@
329344
"aoe3Civs": "AoE3-Zivilisationen",
330345
"aoe4Civs": "AoE4-Zivilisationen",
331346
"aoe4maps": "AoE4-Karten",
347+
"aomgods": "AoM-Götter",
332348
"customOptions": "Individuell",
333349
"turns": "Züge",
334350
"turnCategories": "Kategorien",

src/languages/en_GB.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,21 @@
111111
"ZhuXiLegacy": "Zhu Xi's Legacy",
112112
"JeanneDArc": "Jeanne d'Arc",
113113
"OrderOfTheDragon": "Order of the Dragon"
114+
},
115+
"aomgods": {
116+
"Zeus": "Zeus",
117+
"Poseidon": "Poseidon",
118+
"Hades": "Hades",
119+
"Ra": "Ra",
120+
"Isis": "Isis",
121+
"Set": "Set",
122+
"Odin": "Odin",
123+
"Thor": "Thor",
124+
"Loki": "Loki",
125+
"Freyr": "Freyr",
126+
"Kronos": "Kronos",
127+
"Gaia": "Gaia",
128+
"Oranos": "Oranos"
114129
}
115130
},
116131
"messages": {
@@ -329,6 +344,7 @@
329344
"aoe3Civs": "AoE3 civs",
330345
"aoe4Civs": "AoE4 civs",
331346
"aoe4Maps": "AoE4 maps",
347+
"aomgods": "AoM gods",
332348
"customOptions": "Custom",
333349
"turns": "Turns",
334350
"turnCategories": "Categories",

src/models/AomGod.ts

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import DraftOption from "./DraftOption";
2+
3+
enum Name {
4+
ZEUS = "aomgods.Zeus",
5+
POSEIDON = "aomgods.Poseidon",
6+
HADES = "aomgods.Hades",
7+
RA = "aomgods.Ra",
8+
ISIS = "aomgods.Isis",
9+
SET = "aomgods.Set",
10+
ODIN = "aomgods.Odin",
11+
THOR = "aomgods.Thor",
12+
LOKI = "aomgods.Loki",
13+
FREYR = "aomgods.Freyr",
14+
KRONOS = "aomgods.Kronos",
15+
GAIA = "aomgods.Gaia",
16+
ORANOS = "aomgods.Oranos",
17+
}
18+
19+
class AomGod extends DraftOption {
20+
21+
public static readonly ZEUS: AomGod = new AomGod(Name.ZEUS);
22+
public static readonly POSEIDON: AomGod = new AomGod(Name.POSEIDON);
23+
public static readonly HADES: AomGod = new AomGod(Name.HADES);
24+
public static readonly RA: AomGod = new AomGod(Name.RA);
25+
public static readonly ISIS: AomGod = new AomGod(Name.ISIS);
26+
public static readonly SET: AomGod = new AomGod(Name.SET);
27+
public static readonly ODIN: AomGod = new AomGod(Name.ODIN);
28+
public static readonly THOR: AomGod = new AomGod(Name.THOR);
29+
public static readonly LOKI: AomGod = new AomGod(Name.LOKI);
30+
public static readonly FREYR: AomGod = new AomGod(Name.FREYR);
31+
public static readonly KRONOS: AomGod = new AomGod(Name.KRONOS);
32+
public static readonly GAIA: AomGod = new AomGod(Name.GAIA);
33+
public static readonly ORANOS: AomGod = new AomGod(Name.ORANOS);
34+
35+
36+
37+
// DO NOT CHANGE THE ORDER OF ELEMENTS IN THIS ARRAY!!!
38+
// ONLY APPEND NEW CIVILISATIONS AT THE END!!!
39+
public static readonly ALL = [
40+
AomGod.ZEUS,
41+
AomGod.POSEIDON,
42+
AomGod.HADES,
43+
AomGod.RA,
44+
AomGod.ISIS,
45+
AomGod.SET,
46+
AomGod.ODIN,
47+
AomGod.THOR,
48+
AomGod.LOKI,
49+
AomGod.FREYR,
50+
AomGod.KRONOS,
51+
AomGod.GAIA,
52+
AomGod.ORANOS,
53+
];
54+
55+
private constructor(name: Name) {
56+
super(name, name, AomGod.defaultImageUrlsForCivilisation(name));
57+
}
58+
59+
public static defaultImageUrlsForCivilisation(name: string) {
60+
return {
61+
unit: `/images/aomgods/${name.toLowerCase()}.png`,
62+
emblem: `/images/aomgods/${name.toLowerCase()}.png`,
63+
animated_left: `/images/aomgods/${name.toLowerCase()}.png`,
64+
animated_right: `/images/aomgods/${name.toLowerCase()}.png`,
65+
}
66+
}
67+
68+
}
69+
70+
export default AomGod;
71+
export {Name};

src/models/CivilisationSet.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ enum CivilisationSet {
55
AOE3 = "aoe3",
66
AOE4 = "aoe4",
77
AOE4MAPS = "aoe4maps",
8+
AOMGODS = "aomgods",
89
CUSTOM = "custom"
910
}
1011

0 commit comments

Comments
 (0)