-
diff --git a/binaries/data/mods/public/civs/athen.json b/binaries/data/mods/public/civs/athen.json
index c6d80ba..d0c071a 100644
a
|
b
|
|
162 | 162 | "Iphicrates", |
163 | 163 | "Demosthenes" |
164 | 164 | ], |
| 165 | "Replacements": |
| 166 | [ |
| 167 | { |
| 168 | "Identity": "default_infantry_ranged", |
| 169 | "Template": "units/athen_infantry_slinger_b" |
| 170 | } |
| 171 | ], |
165 | 172 | "SelectableInGameSetup": true |
166 | 173 | } |
-
diff --git a/binaries/data/mods/public/civs/brit.json b/binaries/data/mods/public/civs/brit.json
index 41fdaf1..0fee61d 100644
a
|
b
|
|
138 | 138 | "Dubnovellaunus", |
139 | 139 | "Vosenius" |
140 | 140 | ], |
| 141 | "Replacements": |
| 142 | [ |
| 143 | { |
| 144 | "Identity": "default_infantry_ranged", |
| 145 | "Template": "units/brit_infantry_slinger_b" |
| 146 | }, |
| 147 | { |
| 148 | "Identity": "special_starting_unit", |
| 149 | "Template": "units/brit_war_dog_b" |
| 150 | }, |
| 151 | { |
| 152 | "Identity": "default_house_5", |
| 153 | "Template": "structures/{civ}_house" |
| 154 | } |
| 155 | ], |
141 | 156 | "SelectableInGameSetup": true |
142 | 157 | } |
-
diff --git a/binaries/data/mods/public/civs/cart.json b/binaries/data/mods/public/civs/cart.json
index 59565ec..ed7fa95 100644
a
|
b
|
|
165 | 165 | "Himilco Phameas", |
166 | 166 | "Hasdrubal the Boetharch" |
167 | 167 | ], |
| 168 | "Replacements": |
| 169 | [ |
| 170 | { |
| 171 | "Identity": "default_infantry_ranged", |
| 172 | "Template": "units/cart_infantry_archer_b" |
| 173 | }, |
| 174 | { |
| 175 | "Identity": "default_house_10", |
| 176 | "Template": "structures/{civ}_house" |
| 177 | } |
| 178 | ], |
168 | 179 | "SelectableInGameSetup": true |
169 | 180 | } |
-
diff --git a/binaries/data/mods/public/civs/celt.json b/binaries/data/mods/public/civs/celt.json
index 91c6d12..4f5507e 100644
a
|
b
|
|
162 | 162 | "formations/wedge", |
163 | 163 | "formations/battle_line" |
164 | 164 | ], |
| 165 | "Replacements": |
| 166 | [ |
| 167 | { |
| 168 | "Identity": "default_cavalry", |
| 169 | "Template": "units/celt_cavalry_swordsman_b" |
| 170 | }, |
| 171 | { |
| 172 | "Identity": "default_house_5", |
| 173 | "Template": "structures/{civ}_house" |
| 174 | } |
| 175 | ], |
165 | 176 | "SelectableInGameSetup": false |
166 | 177 | } |
-
diff --git a/binaries/data/mods/public/civs/gaul.json b/binaries/data/mods/public/civs/gaul.json
index feee3c5..a75ff18 100644
a
|
b
|
|
132 | 132 | "Liscus", |
133 | 133 | "Valetiacos" |
134 | 134 | ], |
| 135 | "Replacements": |
| 136 | [ |
| 137 | { |
| 138 | "Identity": "default_house_5", |
| 139 | "Template": "structures/{civ}_house" |
| 140 | } |
| 141 | ], |
135 | 142 | "SelectableInGameSetup": true |
136 | 143 | } |
-
diff --git a/binaries/data/mods/public/civs/hele.json b/binaries/data/mods/public/civs/hele.json
index 721fac8..7f5a4b5 100644
a
|
b
|
|
180 | 180 | "formations/phalanx", |
181 | 181 | "formations/syntagma" |
182 | 182 | ], |
| 183 | "Replacements": |
| 184 | [ |
| 185 | { |
| 186 | "Identity": "default_cavalry", |
| 187 | "Template": "units/hele_cavalry_swordsman_b" |
| 188 | }, |
| 189 | { |
| 190 | "Identity": "default_house_10", |
| 191 | "Template": "structures/{civ}_house" |
| 192 | } |
| 193 | ], |
183 | 194 | "SelectableInGameSetup": false |
184 | 195 | } |
-
diff --git a/binaries/data/mods/public/civs/iber.json b/binaries/data/mods/public/civs/iber.json
index 0a46a62..ce90650 100644
a
|
b
|
|
130 | 130 | "Minurus", |
131 | 131 | "Tautalus" |
132 | 132 | ], |
| 133 | "Replacements": |
| 134 | [ |
| 135 | { |
| 136 | "Identity": "default_infantry_melee", |
| 137 | "Template": "units/iber_infantry_swordsman_b" |
| 138 | }, |
| 139 | { |
| 140 | "Identity": "default_house_5", |
| 141 | "Template": "structures/{civ}_house" |
| 142 | } |
| 143 | ], |
133 | 144 | "SelectableInGameSetup": true |
134 | 145 | } |
-
diff --git a/binaries/data/mods/public/civs/mace.json b/binaries/data/mods/public/civs/mace.json
index b8bcc7c..890b0df 100644
a
|
b
|
|
166 | 166 | "Craterus", |
167 | 167 | "Meleager" |
168 | 168 | ], |
| 169 | "Replacements": |
| 170 | [ |
| 171 | { |
| 172 | "Identity": "default_house_10", |
| 173 | "Template": "structures/{civ}_house" |
| 174 | } |
| 175 | ], |
169 | 176 | "SelectableInGameSetup": true |
170 | 177 | } |
-
diff --git a/binaries/data/mods/public/civs/maur.json b/binaries/data/mods/public/civs/maur.json
index 869ed07..3fe35f2 100644
a
|
b
|
|
147 | 147 | "Satadhanvan Maurya", |
148 | 148 | "Brihadratha Maurya" |
149 | 149 | ], |
| 150 | "Replacements": |
| 151 | [ |
| 152 | { |
| 153 | "Identity": "default_infantry_ranged", |
| 154 | "Template": "units/maur_infantry_archer_b" |
| 155 | }, |
| 156 | { |
| 157 | "Identity": "special_starting_unit", |
| 158 | "Template": "units/maur_support_elephant" |
| 159 | }, |
| 160 | { |
| 161 | "Identity": "default_house_5", |
| 162 | "Template": "structures/{civ}_house" |
| 163 | } |
| 164 | ], |
150 | 165 | "SelectableInGameSetup": true |
151 | 166 | } |
-
diff --git a/binaries/data/mods/public/civs/pers.json b/binaries/data/mods/public/civs/pers.json
index 7e0765c..c4b704f 100644
a
|
b
|
|
153 | 153 | "Haxamanish", |
154 | 154 | "Xsayarsa II" |
155 | 155 | ], |
| 156 | "Replacements": |
| 157 | [ |
| 158 | { |
| 159 | "Identity": "default_infantry_ranged", |
| 160 | "Template": "units/pers_infantry_archer_b" |
| 161 | }, |
| 162 | { |
| 163 | "Identity": "default_house_10", |
| 164 | "Template": "structures/{civ}_house" |
| 165 | } |
| 166 | ], |
156 | 167 | "SelectableInGameSetup": true |
157 | 168 | } |
-
diff --git a/binaries/data/mods/public/civs/ptol.json b/binaries/data/mods/public/civs/ptol.json
index c5300aa..e03b5ca 100644
a
|
b
|
|
171 | 171 | "Arsinoe IV", |
172 | 172 | "Arsinoe II" |
173 | 173 | ], |
| 174 | "Replacements": |
| 175 | [ |
| 176 | { |
| 177 | "Identity": "default_infantry_ranged", |
| 178 | "Template": "units/ptol_infantry_archer_b" |
| 179 | }, |
| 180 | { |
| 181 | "Identity": "default_cavalry", |
| 182 | "Template": "units/ptol_cavalry_archer_b" |
| 183 | }, |
| 184 | { |
| 185 | "Identity": "default_house_5", |
| 186 | "Template": "structures/{civ}_house" |
| 187 | } |
| 188 | ], |
174 | 189 | "SelectableInGameSetup": true |
175 | 190 | } |
-
diff --git a/binaries/data/mods/public/civs/rome.json b/binaries/data/mods/public/civs/rome.json
index 62a3f07..7654277 100644
a
|
b
|
|
141 | 141 | "Quintus Caecilius Metellus Pius", |
142 | 142 | "Marcus Licinius Crassus" |
143 | 143 | ], |
| 144 | "Replacements": |
| 145 | [ |
| 146 | { |
| 147 | "Identity": "default_cavalry", |
| 148 | "Template": "units/rome_cavalry_spearman_b" |
| 149 | }, |
| 150 | { |
| 151 | "Identity": "default_infantry_melee", |
| 152 | "Template": "units/rome_infantry_swordsman_b" |
| 153 | }, |
| 154 | { |
| 155 | "Identity": "default_house_10", |
| 156 | "Template": "structures/{civ}_house" |
| 157 | } |
| 158 | ], |
144 | 159 | "SelectableInGameSetup": true |
145 | 160 | } |
-
diff --git a/binaries/data/mods/public/civs/sele.json b/binaries/data/mods/public/civs/sele.json
index 7bccc59..babf9b1 100644
a
|
b
|
|
179 | 179 | "Antiochus XIII Asiaticus", |
180 | 180 | "Philip II Philoromaeus" |
181 | 181 | ], |
| 182 | "Replacements": |
| 183 | [ |
| 184 | { |
| 185 | "Identity": "default_infantry_ranged", |
| 186 | "Template": "units/sele_infantry_spearman_2_b" |
| 187 | }, |
| 188 | { |
| 189 | "Identity": "default_cavalry", |
| 190 | "Template": "units/sele_cavalry_javelinist" |
| 191 | }, |
| 192 | { |
| 193 | "Identity": "default_house_10", |
| 194 | "Template": "structures/{civ}_house" |
| 195 | } |
| 196 | ], |
182 | 197 | "SelectableInGameSetup": true |
183 | 198 | } |
-
diff --git a/binaries/data/mods/public/civs/spart.json b/binaries/data/mods/public/civs/spart.json
index 509ff53..eaace17 100644
a
|
b
|
|
155 | 155 | "Eucleidas", |
156 | 156 | "Agesipolis" |
157 | 157 | ], |
| 158 | "Replacements": |
| 159 | [ |
| 160 | { |
| 161 | "Identity": "default_house_10", |
| 162 | "Template": "structures/{civ}_house" |
| 163 | } |
| 164 | ], |
158 | 165 | "SelectableInGameSetup": true |
159 | 166 | } |
-
diff --git a/binaries/data/mods/public/civs/theb.json b/binaries/data/mods/public/civs/theb.json
index 0231148..af30173 100644
a
|
b
|
|
147 | 147 | "Lycus", |
148 | 148 | "Labdacus" |
149 | 149 | ], |
| 150 | "Replacements": |
| 151 | [ |
| 152 | ], |
150 | 153 | "SelectableInGameSetup": false |
151 | 154 | } |
-
diff --git a/binaries/data/mods/public/simulation/components/SkirmishReplacer.js b/binaries/data/mods/public/simulation/components/SkirmishReplacer.js
index 2ab5cc0..110d972 100644
a
|
b
|
function SkirmishReplacer() {}
|
2 | 2 | |
3 | 3 | SkirmishReplacer.prototype.Schema = |
4 | 4 | "<optional>" + |
| 5 | "<optional>" + |
| 6 | "<attribute name='id'>" + |
| 7 | "<text/>" + |
| 8 | "</attribute>" + |
| 9 | "</optional>" + |
5 | 10 | "<oneOrMore>" + |
6 | 11 | "<element a:help='Replacement template for the civ which this element is named after or general. If no element is defined for a civ the general element is used instead. If this element is empty the entity is just deleted. The general element gets used if no civ specific element is present and replaces {civ} with the civ code.'>" + |
7 | 12 | "<anyName/>" + |
… |
… |
SkirmishReplacer.prototype.Init = function()
|
16 | 21 | { |
17 | 22 | }; |
18 | 23 | |
| 24 | //this function gets the replacement entities from the {civ}.json file |
| 25 | function getReplacementEntities(civ) |
| 26 | { |
| 27 | var rawCivData = Engine.ReadCivJSONFile(civ+".json"); |
| 28 | if (!(rawCivData && rawCivData.Replacements)) |
| 29 | throw("SkirmishReplacer.js: Error reading '"+civ+".json'"); |
| 30 | |
| 31 | return rawCivData.Replacements; |
| 32 | } |
| 33 | |
19 | 34 | SkirmishReplacer.prototype.OnOwnershipChanged = function(msg) |
20 | 35 | { |
21 | 36 | if (msg.to == 0) |
… |
… |
SkirmishReplacer.prototype.ReplaceEntities = function()
|
26 | 41 | { |
27 | 42 | var cmpPlayer = QueryOwnerInterface(this.entity, IID_Player); |
28 | 43 | var civ = cmpPlayer.GetCiv(); |
29 | | |
| 44 | |
| 45 | var replacementEntities = getReplacementEntities(civ); |
30 | 46 | var templateName = ""; |
31 | | if (civ in this.template) |
32 | | templateName = this.template[civ]; |
33 | | else if ("general" in this.template) |
34 | | templateName = this.template.general; |
| 47 | var found = false; |
| 48 | if(this.template.id){ |
| 49 | for(var j = 0; j < replacementEntities.length && !found; ++j){ |
| 50 | if(this.template.id==replacementEntities[j].Identity){ |
| 51 | templateName = replacementEntities[j].Template; |
| 52 | found = true |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | if(!found){ |
| 57 | if (civ in this.template) //left in to accomodate for old skirmish template files until transition is complete |
| 58 | templateName = this.template[civ]; |
| 59 | else if ("general" in this.template) |
| 60 | templateName = this.template.general; |
| 61 | } |
35 | 62 | |
36 | 63 | if (!templateName || civ == "gaia") |
37 | 64 | { |
-
diff --git a/binaries/data/mods/public/simulation/templates/skirmish/structures/default_house_10.xml b/binaries/data/mods/public/simulation/templates/skirmish/structures/default_house_10.xml
index 9a7859a..1256a88 100644
a
|
b
|
|
5 | 5 | <Tooltip>Changes in a 10-pop house for civilisations with those houses, is deleted for other civs</Tooltip> |
6 | 6 | </Identity> |
7 | 7 | <ProductionQueue disable=""/> |
8 | | <SkirmishReplacer> |
9 | | <athen>structures/{civ}_house</athen> |
10 | | <cart>structures/{civ}_house</cart> |
11 | | <hele>structures/{civ}_house</hele> |
12 | | <mace>structures/{civ}_house</mace> |
13 | | <pers>structures/{civ}_house</pers> |
14 | | <rome>structures/{civ}_house</rome> |
15 | | <spart>structures/{civ}_house</spart> |
16 | | </SkirmishReplacer> |
| 8 | <SkirmishReplacer id="default_house_10" disable=""/> |
17 | 9 | <VisualActor> |
18 | 10 | <Actor>structures/athenians/house.xml</Actor> |
19 | 11 | </VisualActor> |
-
diff --git a/binaries/data/mods/public/simulation/templates/skirmish/structures/default_house_5.xml b/binaries/data/mods/public/simulation/templates/skirmish/structures/default_house_5.xml
index 0e3ab27..856686d 100644
a
|
b
|
|
9 | 9 | <Height>5.0</Height> |
10 | 10 | </Footprint> |
11 | 11 | <ProductionQueue disable=""/> |
12 | | <SkirmishReplacer> |
13 | | <brit>structures/{civ}_house</brit> |
14 | | <celt>structures/{civ}_house</celt> |
15 | | <gaul>structures/{civ}_house</gaul> |
16 | | <iber>structures/{civ}_house</iber> |
17 | | <maur>structures/{civ}_house</maur> |
18 | | <ptol>structures/{civ}_house</ptol> |
19 | | </SkirmishReplacer> |
| 12 | <SkirmishReplacer id="default_house_5" disable=""/> |
20 | 13 | <VisualActor> |
21 | 14 | <Actor>structures/ptolemies/house.xml</Actor> |
22 | 15 | </VisualActor> |
-
diff --git a/binaries/data/mods/public/simulation/templates/skirmish/units/default_cavalry.xml b/binaries/data/mods/public/simulation/templates/skirmish/units/default_cavalry.xml
index 5fb664b..0855e15 100644
a
|
b
|
|
4 | 4 | <Civ>skirm</Civ> |
5 | 5 | </Identity> |
6 | 6 | <Promotion disable=""/> |
7 | | <SkirmishReplacer> |
| 7 | <SkirmishReplacer id="default_cavalry"> |
8 | 8 | <general>units/{civ}_cavalry_javelinist_b</general> |
9 | | <celt>units/celt_cavalry_swordsman_b</celt> |
10 | | <hele>units/hele_cavalry_swordsman_b</hele> |
11 | | <ptol>units/ptol_cavalry_archer_b</ptol> |
12 | | <rome>units/rome_cavalry_spearman_b</rome> |
13 | | <sele>units/sele_cavalry_javelinist</sele> |
14 | 9 | </SkirmishReplacer> |
15 | 10 | <VisualActor> |
16 | 11 | <Actor>units/athenians/cavalry_javelinist_b.xml</Actor> |
-
diff --git a/binaries/data/mods/public/simulation/templates/skirmish/units/default_infantry_melee_b.xml b/binaries/data/mods/public/simulation/templates/skirmish/units/default_infantry_melee_b.xml
index d81c770..0e63f17 100644
a
|
b
|
|
4 | 4 | <Civ>skirm</Civ> |
5 | 5 | </Identity> |
6 | 6 | <Promotion disable=""/> |
7 | | <SkirmishReplacer> |
| 7 | <SkirmishReplacer id="default_infantry_melee"> |
8 | 8 | <general>units/{civ}_infantry_spearman_b</general> |
9 | | <iber>units/iber_infantry_swordsman_b</iber> |
10 | | <rome>units/rome_infantry_swordsman_b</rome> |
11 | | <sele>units/sele_infantry_spearman_2_b</sele> |
12 | 9 | </SkirmishReplacer> |
13 | 10 | <VisualActor> |
14 | 11 | <Actor>units/athenians/infantry_spearman_b.xml</Actor> |
-
diff --git a/binaries/data/mods/public/simulation/templates/skirmish/units/default_infantry_ranged_b.xml b/binaries/data/mods/public/simulation/templates/skirmish/units/default_infantry_ranged_b.xml
index 2c9632e..a350770 100644
a
|
b
|
|
4 | 4 | <Civ>skirm</Civ> |
5 | 5 | </Identity> |
6 | 6 | <Promotion disable=""/> |
7 | | <SkirmishReplacer> |
| 7 | <SkirmishReplacer id="default_infantry_ranged"> |
8 | 8 | <general>units/{civ}_infantry_javelinist_b</general> |
9 | | <athen>units/athen_infantry_slinger_b</athen> |
10 | | <brit>units/brit_infantry_slinger_b</brit> |
11 | | <cart>units/cart_infantry_archer_b</cart> |
12 | | <maur>units/maur_infantry_archer_b</maur> |
13 | | <pers>units/pers_infantry_archer_b</pers> |
14 | | <ptol>units/ptol_infantry_archer_b</ptol> |
15 | | <sele>units/sele_infantry_spearman_2_b</sele> |
16 | 9 | </SkirmishReplacer> |
17 | 10 | <VisualActor> |
18 | 11 | <Actor>units/athenians/infantry_slinger_b.xml</Actor> |
-
diff --git a/binaries/data/mods/public/simulation/templates/skirmish/units/default_support_female_citizen.xml b/binaries/data/mods/public/simulation/templates/skirmish/units/default_support_female_citizen.xml
index 060b0d2..cb01372 100644
a
|
b
|
|
4 | 4 | <Civ>skirm</Civ> |
5 | 5 | </Identity> |
6 | 6 | <SkirmishReplacer> |
| 7 | <id>default_support_female_citizen</id> |
7 | 8 | <general>units/{civ}_support_female_citizen</general> |
8 | 9 | </SkirmishReplacer> |
9 | 10 | <VisualActor> |
-
diff --git a/binaries/data/mods/public/simulation/templates/skirmish/units/special_starting_unit.xml b/binaries/data/mods/public/simulation/templates/skirmish/units/special_starting_unit.xml
index 0b55e88..f45d192 100644
a
|
b
|
|
11 | 11 | <Unit radius="3.0"/> |
12 | 12 | </Obstruction> |
13 | 13 | <Promotion disable=""/> |
14 | | <SkirmishReplacer> |
15 | | <brit>units/brit_war_dog_b</brit> |
| 14 | <SkirmishReplacer id="special_starting_unit"> |
| 15 | <brit>units/brit_war_dog_bs</brit> |
16 | 16 | <maur>units/maur_support_elephant</maur> |
17 | 17 | </SkirmishReplacer> |
18 | 18 | <VisualActor> |