Index: binaries/data/mods/public/globalscripts/Templates.js
===================================================================
--- binaries/data/mods/public/globalscripts/Templates.js
+++ binaries/data/mods/public/globalscripts/Templates.js
@@ -188,14 +188,14 @@
ret.attack[type] = {
"minRange": getAttackStat("MinRange"),
"maxRange": getAttackStat("MaxRange"),
- "elevationBonus": getAttackStat("ElevationBonus"),
+ "elevationRangeBonus": getAttackStat("Projectile/ElevationRangeBonus"),
"damage": {}
};
for (let damageType in template.Attack[type].Damage)
ret.attack[type].damage[damageType] = getAttackStat("Damage/" + damageType);
ret.attack[type].elevationAdaptedRange = Math.sqrt(ret.attack[type].maxRange *
- (2 * ret.attack[type].elevationBonus + ret.attack[type].maxRange));
+ (2 * ret.attack[type].elevationRangeBonus + ret.attack[type].maxRange));
}
ret.attack[type].repeatTime = getAttackStat("RepeatTime");
Index: binaries/data/mods/public/gui/session/input.js
===================================================================
--- binaries/data/mods/public/gui/session/input.js
+++ binaries/data/mods/public/gui/session/input.js
@@ -166,14 +166,14 @@
{
// building can be placed here, and has an attack
// show the range advantage in the tooltip
- var cmd = {
+ let cmd = {
"x": placementSupport.position.x,
"z": placementSupport.position.z,
"range": placementSupport.attack.Ranged.maxRange,
- "elevationBonus": placementSupport.attack.Ranged.elevationBonus,
+ "elevationRangeBonus": placementSupport.attack.Ranged.elevationRangeBonus,
};
- var averageRange = Math.round(Engine.GuiInterfaceCall("GetAverageRangeForBuildings", cmd) - cmd.range);
- var range = Math.round(cmd.range);
+ let averageRange = Math.round(Engine.GuiInterfaceCall("GetAverageRangeForBuildings", cmd) - cmd.range);
+ let range = Math.round(cmd.range);
placementSupport.tooltipMessage = sprintf(translatePlural("Basic range: %(range)s meter", "Basic range: %(range)s meters", range), { "range": range }) + "\n" +
sprintf(translatePlural("Average bonus range: %(range)s meter", "Average bonus range: %(range)s meters", averageRange), { "range": averageRange });
}
Index: binaries/data/mods/public/simulation/components/Attack.js
===================================================================
--- binaries/data/mods/public/simulation/components/Attack.js
+++ binaries/data/mods/public/simulation/components/Attack.js
@@ -89,10 +89,9 @@
"" +
"44.0" +
"20.0" +
- "15.0" +
"800" +
"1600" +
- "1000" +
+ "1000" +
"" +
"" +
"Cavalry" +
@@ -105,6 +104,7 @@
"props/units/weapons/rock_flaming.xml" +
"props/units/weapons/rock_explosion.xml" +
"0.1" +
+ "15.0" +
"" +
"Champion" +
"" +
@@ -154,9 +154,6 @@
"" +
"" +
"" +
- ""+
- "" +
- "" +
"" +
"" +
"" +
@@ -172,7 +169,9 @@
"" +
"" +
"" +
- "" +
+ "" +
+ "" +
+ "" +
"" +
"" +
"" +
@@ -215,6 +214,9 @@
"" +
"" +
"" +
+ ""+
+ "" +
+ "" +
"" +
"" +
Attack.prototype.statusEffectsSchema +
@@ -496,10 +498,10 @@
let min = +(this.template[type].MinRange || 0);
min = ApplyValueModificationsToEntity("Attack/" + type + "/MinRange", min, this.entity);
- let elevationBonus = +(this.template[type].ElevationBonus || 0);
- elevationBonus = ApplyValueModificationsToEntity("Attack/" + type + "/ElevationBonus", elevationBonus, this.entity);
+ let elevationRangeBonus = this.template[type].Projectile ? +(this.template[type].Projectile.ElevationRangeBonus || 0) : 0;
+ elevationRangeBonus = ApplyValueModificationsToEntity("Attack/" + type + "/Projectile/ElevationRangeBonus", elevationRangeBonus, this.entity);
- return { "max": max, "min": min, "elevationBonus": elevationBonus };
+ return { "max": max, "min": min, "elevationRangeBonus": elevationRangeBonus };
};
Attack.prototype.GetBonusTemplate = function(type)
@@ -623,7 +625,7 @@
data.splashStrengths = this.GetAttackStrengths(type + ".Splash");
data.splashBonus = this.GetBonusTemplate(type + ".Splash");
}
- cmpTimer.SetTimeout(SYSTEM_ENTITY, IID_Damage, "MissileHit", timeToTarget * 1000 + +this.template[type].Delay, data);
+ cmpTimer.SetTimeout(SYSTEM_ENTITY, IID_Damage, "MissileHit", +(this.template[type].DamageDelay || 0) + timeToTarget * 1000, data);
}
else if (type == "Capture")
{
Index: binaries/data/mods/public/simulation/components/BuildingAI.js
===================================================================
--- binaries/data/mods/public/simulation/components/BuildingAI.js
+++ binaries/data/mods/public/simulation/components/BuildingAI.js
@@ -106,31 +106,31 @@
*/
BuildingAI.prototype.SetupRangeQuery = function()
{
- var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
+ let cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
if (!cmpAttack)
return;
- var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
+ let cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
if (this.enemyUnitsQuery)
{
cmpRangeManager.DestroyActiveQuery(this.enemyUnitsQuery);
this.enemyUnitsQuery = undefined;
}
- var cmpPlayer = QueryOwnerInterface(this.entity);
+ let cmpPlayer = QueryOwnerInterface(this.entity);
if (!cmpPlayer)
return;
- var enemies = cmpPlayer.GetEnemies();
+ let enemies = cmpPlayer.GetEnemies();
if (enemies.length && enemies[0] == 0)
enemies.shift(); // remove gaia
if (!enemies.length)
return;
- var range = cmpAttack.GetRange(attackType);
+ let range = cmpAttack.GetRange(attackType);
this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery(
- this.entity, range.min, range.max, range.elevationBonus,
+ this.entity, range.min, range.max, range.elevationRangeBonus,
enemies, IID_DamageReceiver, cmpRangeManager.GetEntityFlagMask("normal"));
cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery);
@@ -140,26 +140,26 @@
// This should be called whenever our ownership changes.
BuildingAI.prototype.SetupGaiaRangeQuery = function()
{
- var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
+ let cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
if (!cmpAttack)
return;
- var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
+ let cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
if (this.gaiaUnitsQuery)
{
cmpRangeManager.DestroyActiveQuery(this.gaiaUnitsQuery);
this.gaiaUnitsQuery = undefined;
}
- var cmpPlayer = QueryOwnerInterface(this.entity);
+ let cmpPlayer = QueryOwnerInterface(this.entity);
if (!cmpPlayer || !cmpPlayer.IsEnemy(0))
return;
- var range = cmpAttack.GetRange(attackType);
+ let range = cmpAttack.GetRange(attackType);
// This query is only interested in Gaia entities that can attack.
this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery(
- this.entity, range.min, range.max, range.elevationBonus,
+ this.entity, range.min, range.max, range.elevationRangeBonus,
[0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal"));
cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery);
Index: binaries/data/mods/public/simulation/components/GuiInterface.js
===================================================================
--- binaries/data/mods/public/simulation/components/GuiInterface.js
+++ binaries/data/mods/public/simulation/components/GuiInterface.js
@@ -407,22 +407,22 @@
if (type != "Ranged")
{
// not a ranged attack, set some defaults
- ret.attack[type].elevationBonus = 0;
+ ret.attack[type].elevationRangeBonus = 0;
ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
continue;
}
- ret.attack[type].elevationBonus = range.elevationBonus;
+ ret.attack[type].elevationRangeBonus = range.elevationRangeBonus;
if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
{
// For units, take the range in front of it, no spread. So angle = 0
- ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
+ ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationRangeBonus, 0);
}
else if(cmpPosition && cmpPosition.IsInWorld())
{
// For buildings, take the average elevation around it. So angle = 2*pi
- ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
+ ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationRangeBonus, 2 * Math.PI);
}
else
{
@@ -530,10 +530,10 @@
"z": cmd.z
};
- let elevationBonus = cmd.elevationBonus || 0;
+ let elevationRangeBonus = cmd.elevationRangeBonus || 0;
let range = cmd.range;
- return cmpRangeManager.GetElevationAdaptedRange(pos, rot, range, elevationBonus, 2*Math.PI);
+ return cmpRangeManager.GetElevationAdaptedRange(pos, rot, range, elevationRangeBonus, 2 * Math.PI);
};
GuiInterface.prototype.GetTemplateData = function(player, templateName)
Index: binaries/data/mods/public/simulation/components/UnitAI.js
===================================================================
--- binaries/data/mods/public/simulation/components/UnitAI.js
+++ binaries/data/mods/public/simulation/components/UnitAI.js
@@ -4301,7 +4301,7 @@
let t = targetCmpPosition.GetPosition();
// h is positive when I'm higher than the target
- let h = s.y - t.y + range.elevationBonus;
+ let h = s.y - t.y + range.elevationRangeBonus;
let parabolicMaxRange = Math.sqrt(Math.square(range.max) + 2 * range.max * h);
// No negative roots please
@@ -4417,7 +4417,7 @@
let t = targetCmpPosition.GetPosition();
- let h = s.y - t.y + range.elevationBonus;
+ let h = s.y - t.y + range.elevationRangeBonus;
let maxRange = Math.sqrt(Math.square(range.max) + 2 * range.max * h);
if (maxRange < 0)
Index: binaries/data/mods/public/simulation/components/tests/test_Damage.js
===================================================================
--- binaries/data/mods/public/simulation/components/tests/test_Damage.js
+++ binaries/data/mods/public/simulation/components/tests/test_Damage.js
@@ -34,7 +34,6 @@
"Ranged": {
"MaxRange": 50,
"MinRange": 0,
- "Delay": 0,
"Projectile": {
"Speed": 75.0,
"Spread": 0.5,
Index: binaries/data/mods/public/simulation/templates/structures/rome_army_camp.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/structures/rome_army_camp.xml
+++ binaries/data/mods/public/simulation/templates/structures/rome_army_camp.xml
@@ -21,7 +21,6 @@
0.0
1200
2000
- 0
75.0
1.5
Index: binaries/data/mods/public/simulation/templates/template_structure_civic_civil_centre.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_civic_civil_centre.xml
+++ binaries/data/mods/public/simulation/templates/template_structure_civic_civil_centre.xml
@@ -26,7 +26,6 @@
0.0
1200
2000
- 0
75.0
1.5
Index: binaries/data/mods/public/simulation/templates/template_structure_defensive_tower.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_defensive_tower.xml
+++ binaries/data/mods/public/simulation/templates/template_structure_defensive_tower.xml
@@ -9,7 +9,6 @@
1200
2000
- 0
75.0
1.5
Index: binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_outpost.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_outpost.xml
+++ binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_outpost.xml
@@ -17,7 +17,9 @@
55
13
- 0
+
+ 0
+
Index: binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_sentry.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_sentry.xml
+++ binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_sentry.xml
@@ -12,7 +12,9 @@
70
10
- 9
+
+ 9
+
Index: binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_stone.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_stone.xml
+++ binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_stone.xml
@@ -7,7 +7,9 @@
76
10
- 15
+
+ 15
+
Index: binaries/data/mods/public/simulation/templates/template_structure_defensive_wall_tower.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_defensive_wall_tower.xml
+++ binaries/data/mods/public/simulation/templates/template_structure_defensive_wall_tower.xml
@@ -11,7 +11,6 @@
12.0
1200
2000
- 0
75.0
1.5
Index: binaries/data/mods/public/simulation/templates/template_structure_military_fortress.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_structure_military_fortress.xml
+++ binaries/data/mods/public/simulation/templates/template_structure_military_fortress.xml
@@ -16,7 +16,6 @@
0.0
1200
2000
- 0
75.0
1.5
Index: binaries/data/mods/public/simulation/templates/template_unit_cavalry_ranged.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_cavalry_ranged.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_cavalry_ranged.xml
@@ -11,7 +11,6 @@
0.0
1000
1500
- 0
75.0
3.0
Index: binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_archer.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_archer.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_archer.xml
@@ -11,7 +11,6 @@
0.0
500
1000
- 0
75.0
1.0
Index: binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_javelinist.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_javelinist.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_javelinist.xml
@@ -11,7 +11,6 @@
0.0
750
1250
- 0
62.5
1.0
Index: binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_archer.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_archer.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_archer.xml
@@ -11,7 +11,6 @@
0.0
300
500
- 0
75.0
1.0
Index: binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_javelinist.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_javelinist.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_javelinist.xml
@@ -11,7 +11,6 @@
0.0
500
1000
- 0
62.5
1.0
Index: binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_archer.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_archer.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_archer.xml
@@ -11,7 +11,6 @@
0.0
1200
2000
- 0
75.0
0.5
Index: binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_javelinist.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_javelinist.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_javelinist.xml
@@ -11,7 +11,6 @@
0.0
750
1250
- 0
62.5
0.5
Index: binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_archer.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_archer.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_archer.xml
@@ -11,7 +11,6 @@
0.0
200
300
- 0
75.0
0.5
Index: binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_javelinist.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_javelinist.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_javelinist.xml
@@ -11,7 +11,6 @@
0.0
600
1000
- 0
62.5
0.5
Index: binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged.xml
@@ -16,7 +16,6 @@
0.0
750
1250
- 0
75.0
3.0
Index: binaries/data/mods/public/simulation/templates/template_unit_ship_bireme.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_ship_bireme.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_ship_bireme.xml
@@ -11,7 +11,6 @@
0.0
1000
2000
- 0
75.0
2.0
Index: binaries/data/mods/public/simulation/templates/template_unit_ship_quinquereme.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_ship_quinquereme.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_ship_quinquereme.xml
@@ -11,7 +11,6 @@
10.0
2000
5000
- 0
Circular
10
Index: binaries/data/mods/public/simulation/templates/template_unit_ship_trireme.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_ship_trireme.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_ship_trireme.xml
@@ -11,7 +11,6 @@
0.0
1000
2000
- 0
75.0
2.0
Index: binaries/data/mods/public/simulation/templates/template_unit_siege_boltshooter.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_siege_boltshooter.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_siege_boltshooter.xml
@@ -11,7 +11,6 @@
26.0
3000
4000
- 0
Linear
8.0
Index: binaries/data/mods/public/simulation/templates/template_unit_siege_stonethrower.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_siege_stonethrower.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_siege_stonethrower.xml
@@ -11,7 +11,6 @@
26.0
4000
5000
- 0
37.5
4.0
Index: binaries/data/mods/public/simulation/templates/template_unit_siege_tower.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_siege_tower.xml
+++ binaries/data/mods/public/simulation/templates/template_unit_siege_tower.xml
@@ -9,15 +9,14 @@
55.0
10.0
- 10
1200
2000
- 0
75.0
2.0
9.81
+ 10
Human
Index: binaries/data/mods/public/simulation/templates/units/plane.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/units/plane.xml
+++ binaries/data/mods/public/simulation/templates/units/plane.xml
@@ -11,7 +11,6 @@
80
0
10000
- 0
75.0
1.0
Index: binaries/data/mods/public/simulation/templates/units/theb_siege_fireraiser.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/units/theb_siege_fireraiser.xml
+++ binaries/data/mods/public/simulation/templates/units/theb_siege_fireraiser.xml
@@ -11,7 +11,6 @@
8.0
2000
2000
- 0
10.0
2.0