Index: binaries/data/mods/public/simulation/components/Auras.js
===================================================================
--- binaries/data/mods/public/simulation/components/Auras.js	(révision 17803)
+++ binaries/data/mods/public/simulation/components/Auras.js	(copie de travail)
@@ -76,25 +76,19 @@ Auras.prototype.Init = function()
 		this.affectedPlayers[name] = []; // will be calculated on ownership change
 		var aura = {};
 		aura.affects = this.template[name].Affects;
 		if (this.template[name].AffectedPlayers)
 			aura.affectedPlayers = this.template[name].AffectedPlayers.split(/\s+/);
-		aura.modifications = [];
-		for (var value in this.template[name].Modifications)
-		{
-			var mod = {};
-			mod.value = value.replace(/\./g, "/").replace(/\/\//g, ".");
-			if (this.template[name].Modifications[value].Add)
-				mod.add = +this.template[name].Modifications[value].Add;
-			else if (this.template[name].Modifications[value].Multiply)
-				mod.multiply = +this.template[name].Modifications[value].Multiply;
-			aura.modifications.push(mod);
-		}
 		this.auras[name] = aura;
 	}
 };
 
+Auras.prototype.GetModifierIdentifier = function(name, mod)
+{
+		return this.templateName + "/" + name + "/" + mod.value;
+};
+
 Auras.prototype.GetDescriptions = function()
 {
 	var ret = {};
 	for each (var aura in this.template)
 		if (aura.AuraName)
@@ -236,10 +230,27 @@ Auras.prototype.Clean = function()
 
 		if (this[name].rangeQuery)
 			cmpRangeManager.DestroyActiveQuery(this[name].rangeQuery);
 	}
 
+	for (let name in this.template)
+	{
+		let modifications = [];
+		for (let value in this.template[name].Modifications)
+		{
+			let mod = {};
+			mod.value = value.replace(/\./g, "/").replace(/\/\//g, ".");
+			let templateModifications = this.template[name].Modifications[value];
+			if (templateModifications.Add)
+				mod.add = ApplyValueModificationsToEntity("Auras/"+name+"/Modifications/"+mod.value+"/Add", +templateModifications.Add, this.entity);
+			else if (templateModifications.Multiply)
+				mod.multiply = ApplyValueModificationsToEntity("Auras/"+name+"/Modifications/"+mod.value+"/Multiply", +templateModifications.Multiply, this.entity);
+			modifications.push(mod);
+		}
+		this.auras[name].modifications = modifications;
+	}
+
 	for (let name of auraNames)
 	{
 		// only calculate the affected players on re-applying the bonuses
 		// this makes sure the template bonuses are removed from the correct players
 		this.CalculateAffectedPlayers(name);
@@ -329,11 +340,11 @@ Auras.prototype.ApplyTemplateBonus = fun
 	var cmpAuraManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AuraManager);
 	var classes = this.GetClasses(name);
 
 	for (let mod of modifications)
 		for (let player of players)
-			cmpAuraManager.ApplyTemplateBonus(mod.value, player, classes, mod, this.templateName + "/" + name + "/" + mod.value);
+			cmpAuraManager.ApplyTemplateBonus(mod.value, player, classes, mod, this.GetModifierIdentifier(name, mod));
 };
 
 Auras.prototype.RemoveFormationBonus = function(memberList)
 {
 	var auraNames = this.GetAuraNames().filter(n => this.IsFormationAura(n));
@@ -358,11 +369,11 @@ Auras.prototype.RemoveTemplateBonus = fu
 	var classes = this.GetClasses(name);
 	var players =  this.GetAffectedPlayers(name);
 
 	for each (var mod in modifications)
 		for each (var player in players)
-			cmpAuraManager.RemoveTemplateBonus(mod.value, player, classes, this.templateName + "/" + name + "/" + mod.value);
+			cmpAuraManager.RemoveTemplateBonus(mod.value, player, classes, this.GetModifierIdentifier(name, mod));
 };
 
 Auras.prototype.ApplyBonus = function(name, ents)
 {
 	var validEnts = this.GiveMembersWithValidClass(name, ents);
@@ -370,11 +381,11 @@ Auras.prototype.ApplyBonus = function(na
 		return;
 	this[name].targetUnits = this[name].targetUnits.concat(validEnts);
 	var modifications = this.GetModifications(name);
 	var cmpAuraManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AuraManager);
 	for each (let mod in modifications)
-		cmpAuraManager.ApplyBonus(mod.value, validEnts, mod, this.templateName + "/" + name + "/" + mod.value);
+		cmpAuraManager.ApplyBonus(mod.value, validEnts, mod, this.GetModifierIdentifier(name, mod));
 	// update status bars if this has an icon
 	if (!this.GetOverlayIcon(name))
 		return;
 	for (let ent of validEnts)
 	{
@@ -391,11 +402,11 @@ Auras.prototype.RemoveBonus = function(n
 		return;
 	this[name].targetUnits = this[name].targetUnits.filter(v => validEnts.indexOf(v) == -1);
 	var modifications = this.GetModifications(name);
 	var cmpAuraManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AuraManager);
 	for each (let mod in modifications)
-		cmpAuraManager.RemoveBonus(mod.value, validEnts, this.templateName + "/" + name + "/" + mod.value);
+		cmpAuraManager.RemoveBonus(mod.value, validEnts, this.GetModifierIdentifier(name, mod));
 	// update status bars if this has an icon
 	if (!this.GetOverlayIcon(name))
 		return;
 	for (let ent of validEnts)
 	{
Index: binaries/data/mods/public/simulation/components/Player.js
===================================================================
--- binaries/data/mods/public/simulation/components/Player.js	(révision 17803)
+++ binaries/data/mods/public/simulation/components/Player.js	(copie de travail)
@@ -142,11 +142,11 @@ Player.prototype.SetMaxPopulation = func
 	this.maxPop = max;
 };
 
 Player.prototype.GetMaxPopulation = function()
 {
-	return Math.round(ApplyValueModificationsToPlayer("Player/MaxPopulation", this.maxPop, this.entity));
+	return Math.round(ApplyValueModificationsToPlayer("Player/MaxPopulation", this.maxPop, this.entity, this.playerID));
 };
 
 Player.prototype.SetGatherRateMultiplier = function(value)
 {
 	this.gatherRateMultiplier = value;
Index: binaries/data/mods/public/simulation/data/technologies/pop_wonder.json
===================================================================
--- binaries/data/mods/public/simulation/data/technologies/pop_wonder.json	(révision 17803)
+++ binaries/data/mods/public/simulation/data/technologies/pop_wonder.json	(copie de travail)
@@ -8,14 +8,14 @@
 		"ptol": "Peristyle",
 		"rome": "Peristyle",
 		"pers": "Paradise"
 	},
 	"description": "The wonder attracts many more people to your civilization.",
-	"cost": {"food": 3000, "wood": 3000, "stone": 500, "metal": 500},
+	"cost": {"food": 2000, "wood": 3000, "stone": 500, "metal": 500},
 	"requirements": {"tech": "phase_city"},
 	"requirementsTooltip": "Unlocked in City Phase.",
 	"icon": "special_treasure.png",
 	"researchTime": 40,
-	"tooltip": "+50 maximum population cap.",
-	"modifications": [{"value": "Player/MaxPopulation", "add": 50}],
+	"tooltip": "Increase the population bonus of the wonder by 40.",
+	"modifications": [{"value": "Auras/Aura1/Modifications/Player/MaxPopulation/Add", "add": 40}],
 	"soundComplete": "interface/alarm/alarm_upgradearmory.xml"
 }
Index: binaries/data/mods/public/simulation/helpers/ValueModification.js
===================================================================
--- binaries/data/mods/public/simulation/helpers/ValueModification.js	(révision 17803)
+++ binaries/data/mods/public/simulation/helpers/ValueModification.js	(copie de travail)
@@ -1,6 +1,6 @@
-// Little helper functions to make applying technology more convenient
+// Little helper functions to make applying technology and auras more convenient
 
 function ApplyValueModificationsToEntity(tech_type, current_value, entity)
 {
 	let value = current_value;
 	let cmpTechnologyManager = QueryOwnerInterface(entity, IID_TechnologyManager);
@@ -11,18 +11,16 @@ function ApplyValueModificationsToEntity
 	if (!cmpAuraManager)
 		return value;
 	return cmpAuraManager.ApplyModifications(tech_type, value, entity);
 }
 
-function ApplyValueModificationsToPlayer(tech_type, current_value, player_entity)
+function ApplyValueModificationsToPlayer(tech_type, current_value, playerEntity, playerID)
 {
-	let cmpTechnologyManager = Engine.QueryInterface(player_entity, IID_TechnologyManager);
-
-	if (!cmpTechnologyManager)
-		return current_value;
-
-	return cmpTechnologyManager.ApplyModifications(tech_type, current_value, player_entity);
+	let cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
+	let entityTemplateName = cmpTemplateManager.GetCurrentTemplateName(playerEntity);
+	let entityTemplate = cmpTemplateManager.GetTemplate(entityTemplateName);
+	return ApplyValueModificationsToTemplate(tech_type, current_value, playerID, entityTemplate);
 }
 
 function ApplyValueModificationsToTemplate(tech_type, current_value, playerID, template)
 {
 	let value = current_value;
Index: binaries/data/mods/public/simulation/templates/special/player.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/special/player.xml	(révision 17803)
+++ binaries/data/mods/public/simulation/templates/special/player.xml	(copie de travail)
@@ -46,11 +46,16 @@
       <CivilCentre>
         <RequiredTechs datatype="tokens">phase_town</RequiredTechs>
       </CivilCentre>
     </LimitRemovers>
   </EntityLimits>
+  <Identity>
+    <Civ></Civ>
+    <GenericName>Player</GenericName>
+    <Classes datatype="tokens">Player</Classes>
+  </Identity>
   <Player>
-	<SharedLosTech>unlock_shared_los</SharedLosTech>
+    <SharedLosTech>unlock_shared_los</SharedLosTech>
   </Player>
   <StatisticsTracker/>
   <TechnologyManager/>
 </Entity>
Index: binaries/data/mods/public/simulation/templates/structures/athen_wonder.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/athen_wonder.xml	(révision 17803)
+++ binaries/data/mods/public/simulation/templates/structures/athen_wonder.xml	(copie de travail)
@@ -2,18 +2,10 @@
 <Entity parent="template_structure_wonder">
   <Footprint>
     <Square width="28.0" depth="58.0"/>
     <Height>12.0</Height>
   </Footprint>
-  <GarrisonHolder>
-    <Max>30</Max>
-    <EjectHealth>0.1</EjectHealth>
-    <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
-    <List datatype="tokens">Support Infantry Cavalry</List>
-    <BuffHeal>3</BuffHeal>
-    <LoadingRange>2</LoadingRange>
-  </GarrisonHolder>
   <Identity>
     <Civ>athen</Civ>
     <SpecificName>Naós Parthenṓn</SpecificName>
     <History>The Hellenes built marvelous temples in order to honour their polytheistic pantheon. While all gods were venerated, a specific patron deity was supposed to watch over each polis.</History>
     <Tooltip>Bring glory to your civilization and add large tracts of land to your empire. Garrison up to 30 units to heal them at a quick rate.</Tooltip>
Index: binaries/data/mods/public/simulation/templates/structures/cart_wonder.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/cart_wonder.xml	(révision 17803)
+++ binaries/data/mods/public/simulation/templates/structures/cart_wonder.xml	(copie de travail)
@@ -2,18 +2,10 @@
 <Entity parent="template_structure_wonder">
   <Footprint>
     <Square width="29.0" depth="59.0"/>
     <Height>12.0</Height>
   </Footprint>
-  <GarrisonHolder>
-    <Max>30</Max>
-    <EjectHealth>0.1</EjectHealth>
-    <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
-    <List datatype="tokens">Support Infantry Cavalry</List>
-    <BuffHeal>3</BuffHeal>
-    <LoadingRange>2</LoadingRange>
-  </GarrisonHolder>
   <Identity>
    <Civ>cart</Civ>
     <SpecificName>Temple of Ba'al Hammon</SpecificName>
     <History>Dating from the 2nd Century BC, the Mausoleum of Atban in northern Tunisia is over twenty metres high and was built by the inhabitants of Dougga for a Numidian prince.</History>
   </Identity>
Index: binaries/data/mods/public/simulation/templates/structures/iber_wonder.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/iber_wonder.xml	(révision 17803)
+++ binaries/data/mods/public/simulation/templates/structures/iber_wonder.xml	(copie de travail)
@@ -2,18 +2,10 @@
 <Entity parent="template_structure_wonder">
   <Footprint>
     <Square width="43.0" depth="43.0"/>
     <Height>14.0</Height>
   </Footprint>
-  <GarrisonHolder>
-    <Max>30</Max>
-    <EjectHealth>0.1</EjectHealth>
-    <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
-    <List datatype="tokens">Support Infantry Cavalry</List>
-    <BuffHeal>3</BuffHeal>
-    <LoadingRange>2</LoadingRange>
-  </GarrisonHolder>
   <Identity>
     <Civ>iber</Civ>
     <SpecificName>Cancho Roano</SpecificName>
     <History>ToDo</History>
   </Identity>
Index: binaries/data/mods/public/simulation/templates/structures/mace_wonder.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/mace_wonder.xml	(révision 17803)
+++ binaries/data/mods/public/simulation/templates/structures/mace_wonder.xml	(copie de travail)
@@ -2,18 +2,10 @@
 <Entity parent="template_structure_wonder">
   <Footprint>
     <Square width="28.0" depth="58.0"/>
     <Height>12.0</Height>
   </Footprint>
-  <GarrisonHolder>
-    <Max>30</Max>
-    <EjectHealth>0.1</EjectHealth>
-    <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
-    <List datatype="tokens">Support Infantry Cavalry</List>
-    <BuffHeal>3</BuffHeal>
-    <LoadingRange>2</LoadingRange>
-  </GarrisonHolder>
   <Identity>
     <Civ>mace</Civ>
     <SpecificName>Naós Parthenṓn</SpecificName>
     <History>The Hellenes built marvelous temples in order to honour their polytheistic pantheon. While all gods were venerated, a specific patron deity was supposed to watch over each polis.</History>
     <Tooltip>Bring glory to your civilization and add large tracts of land to your empire. Garrison up to 30 units to heal them at a quick rate.</Tooltip>
Index: binaries/data/mods/public/simulation/templates/structures/pers_wonder.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/pers_wonder.xml	(révision 17803)
+++ binaries/data/mods/public/simulation/templates/structures/pers_wonder.xml	(copie de travail)
@@ -10,13 +10,10 @@
   <Identity>
     <Civ>pers</Civ>
     <SpecificName>Hanging Gardens of Babylon</SpecificName>
     <History>A magnificent structure built in the 6th century BC by the Neo-Babylonian king Nebuchadnezzar II in order to please his wife Amytis of Media, who was homesick for the gardens and mountains of her homeland.</History>
   </Identity>
-  <Loot>
-    <xp>200</xp>
-  </Loot>
   <Obstruction>
     <Static width="59.0" depth="59.0"/>
   </Obstruction>
   <StatusBars>
     <BarWidth>6.0</BarWidth>
Index: binaries/data/mods/public/simulation/templates/structures/ptol_wonder.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/ptol_wonder.xml	(révision 17803)
+++ binaries/data/mods/public/simulation/templates/structures/ptol_wonder.xml	(copie de travail)
@@ -2,18 +2,10 @@
 <Entity parent="template_structure_wonder">
   <Footprint>
     <Square width="48.0" depth="66.0"/>
     <Height>20.0</Height>
   </Footprint>
-  <GarrisonHolder>
-    <Max>30</Max>
-    <EjectHealth>0.1</EjectHealth>
-    <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
-    <List datatype="tokens">Support Infantry Cavalry</List>
-    <BuffHeal>3</BuffHeal>
-    <LoadingRange>2</LoadingRange>
-  </GarrisonHolder>
   <Identity>
     <Civ>ptol</Civ>
     <SpecificName>Temple of Edfu</SpecificName>
     <History>The Temple of Edfu is an ancient Egyptian temple located on the west bank of the Nile in the city of Edfu which was known in Greco-Roman times as Apollonopolis Magna, after the chief god Horus-Apollo.The temple, dedicated to the falcon god Horus, was built in the Ptolemaic period between 237 and 57 BCE. In modern times, it is one of the best preserved temples of Egypt.</History>
   </Identity>
Index: binaries/data/mods/public/simulation/templates/structures/rome_wonder.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/rome_wonder.xml	(révision 17803)
+++ binaries/data/mods/public/simulation/templates/structures/rome_wonder.xml	(copie de travail)
@@ -2,18 +2,10 @@
 <Entity parent="template_structure_wonder">
   <Footprint>
     <Square width="24.0" depth="44.0"/>
     <Height>12.0</Height>
   </Footprint>
-  <GarrisonHolder>
-    <Max>30</Max>
-    <EjectHealth>0.1</EjectHealth>
-    <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
-    <List datatype="tokens">Support Infantry Cavalry</List>
-    <BuffHeal>3</BuffHeal>
-    <LoadingRange>2</LoadingRange>
-  </GarrisonHolder>
   <Identity>
     <Civ>rome</Civ>
     <SpecificName>Aedes Iovis Optimi Maximi</SpecificName>
     <History>.</History>
   </Identity>
Index: binaries/data/mods/public/simulation/templates/structures/spart_wonder.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/spart_wonder.xml	(révision 17803)
+++ binaries/data/mods/public/simulation/templates/structures/spart_wonder.xml	(copie de travail)
@@ -2,18 +2,10 @@
 <Entity parent="template_structure_wonder">
   <Footprint>
     <Square width="28.0" depth="58.0"/>
     <Height>12.0</Height>
   </Footprint>
-  <GarrisonHolder>
-    <Max>30</Max>
-    <EjectHealth>0.1</EjectHealth>
-    <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
-    <List datatype="tokens">Support Infantry Cavalry</List>
-    <BuffHeal>3</BuffHeal>
-    <LoadingRange>2</LoadingRange>
-  </GarrisonHolder>
   <Identity>
     <Civ>spart</Civ>
     <SpecificName>Naós Parthenṓn</SpecificName>
     <History>The Hellenes built marvelous temples in order to honour their polytheistic pantheon. While all gods were venerated, a specific patron deity was supposed to watch over each polis.</History>
     <Tooltip>Bring glory to your civilization and add large tracts of land to your empire. Garrison up to 30 units to heal them at a quick rate.</Tooltip>
Index: binaries/data/mods/public/simulation/templates/template_structure_wonder.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_wonder.xml	(révision 17803)
+++ binaries/data/mods/public/simulation/templates/template_structure_wonder.xml	(copie de travail)
@@ -8,42 +8,60 @@
       <Hack>2</Hack>
       <Pierce>10</Pierce>
       <Crush>2</Crush>
     </Foundation>
   </Armour>
+  <Auras>
+    <Aura1>
+      <Type>global</Type>
+      <Affects>Player</Affects>
+      <Modifications>
+        <Player.MaxPopulation> <Add>10</Add> </Player.MaxPopulation>
+      </Modifications>
+      <AuraName>Wonder Aura</AuraName>
+      <AuraDescription>+10 maximum population cap.</AuraDescription>
+     </Aura1>
+  </Auras>
   <BuildRestrictions>
     <Category>Wonder</Category>
   </BuildRestrictions>
   <Capturable>
-    <CapturePoints>1500</CapturePoints>
+    <CapturePoints>2000</CapturePoints>
     <RegenRate>5.0</RegenRate>
   </Capturable>
   <Cost>
     <BuildTime>1000</BuildTime>
     <Resources>
-      <food>0</food>
+      <food>1000</food>
       <wood>1000</wood>
       <stone>1000</stone>
       <metal>1000</metal>
     </Resources>
   </Cost>
   <Footprint>
     <Square width="34.0" depth="34.0"/>
     <Height>10.0</Height>
   </Footprint>
-  <GarrisonHolder disable=""/>
+  <GarrisonHolder>
+    <Max>30</Max>
+    <EjectHealth>0.1</EjectHealth>
+    <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
+    <List datatype="tokens">Support Infantry Cavalry</List>
+    <BuffHeal>3</BuffHeal>
+    <LoadingRange>2</LoadingRange>
+  </GarrisonHolder>
   <Health>
     <Max>5000</Max>
     <SpawnEntityOnDeath>rubble/rubble_stone_6x6</SpawnEntityOnDeath>
   </Health>
   <Identity>
     <GenericName>Wonder</GenericName>
     <Tooltip>Bring glory to your civilization and add large tracts of land to your empire.</Tooltip>
     <Classes datatype="tokens">
 	  City
 	  Wonder
-	</Classes>
+    </Classes>
     <Icon>structures/wonder.png</Icon>
     <RequiredTechnology>phase_city</RequiredTechnology>
   </Identity>
   <Loot>
     <xp>200</xp>
