Page MenuHomeWildfire Games

clean up tower classes
ClosedPublic

Authored by Nescio on Jan 8 2020, 11:03 PM.

Details

Reviewers
Silier
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP23853: Clean up tower classes and related changes.
Summary

The recent introduction of the artillery and bolt towers messed up some things, because the new templates were carelessly copied from the scout/stone/defense tower templates. This patch tries to bring some order and does the following:

  • Classes:
    • The Defensive class is made visible (cf. Civic, Economic, Military).
    • The Fortress class is made visible (because of build restrictions).
    • The Tower class defined in template_structure_defensive_tower.xml is now visible.
    • The unused GarrisonTower class is removed.
    • The DefenseTower class is deprecated in favour of one unique class in each of the *_tower.xml children templates:
      • *_artillery.xmlArtilleryTower
      • *_bolt.xmlBoltTower
      • *_sentry.xmlSentryTower
      • *_stone.xmlStoneTower
    • template_structure_defensive_wall_tower.xml does not inherit from *_tower and therefore has a WallTower class instead of a Tower class.
  • Updated the Identity.js file accordingly.
  • Updated the Petra AI files accordingly (DefenseTowerTower).
  • Tower build restrictions are changed to simply Tower.
  • Technologies:
    • tower_armour.json affects all towers, but not outposts (unchanged).
    • tower_decay.json and tower_vision.json affect only outposts (unchanged).
    • tower_crenellations.json, tower_murderholes.json, tower_range.json, and tower_watch.json affect now only the Sentry and Stone towers, instead of all towers. This alters gameplay for the Artillery and Bolt tower, but those shouldn't have been benefitting from arrow tower technologies anyway.
    • Standardized the tooltips per the style guide.
  • Updated the <Identity/Tooltip> in the tower templates.
  • [EDIT] Inserted <BatchTimeModifier>1.0</BatchTimeModifier> in template_structure.xml, where the <ProductionQueue> is defined, and removed the <BatchTimeModifier> from templates that can't train any units.

Checked with grep -ir -e DefenseTower -e GarrisonTower simulation/*

Related: D2494, D2495.

Test Plan

Check for mistakes and omissions.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/81/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 121| 121| EntityLimits.prototype.UpdateLimitsFromTech = function(tech)
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124|    |-		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
|    | 124|+		if ("RequiredTechs" in this.removers[category] && this.removers[category].RequiredTechs.indexOf(tech) !== -1)
| 125| 125| 			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category].RequiredTechs.splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category]["RequiredTechs"].splice(this.removers[category].RequiredTechs.indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 133| 133| 	{
| 134| 134| 		var nolimit = true;
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136|    |-			nolimit = !this.removers[category]["RequiredTechs"].length;
|    | 136|+			nolimit = !this.removers[category].RequiredTechs.length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138| 138| 			for (var cls of this.removers[category]["RequiredClasses"])
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136| 136| 			nolimit = !this.removers[category]["RequiredTechs"].length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 138|+			for (var cls of this.removers[category].RequiredClasses)
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
| 140| 140| 
| 141| 141| 		if (nolimit && this.limit[category] !== undefined)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": { "category": category, "limit": this.limit[category]},
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": {"category": category, "limit": this.limit[category] },
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 266| 266| 
| 267| 267| 	for (var category in this.removers)
| 268| 268| 		if ("RequiredClasses" in this.removers[category])
| 269|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 269|+			for (var cls of this.removers[category].RequiredClasses)
| 270| 270| 				if (classes.indexOf(cls) !== -1)
| 271| 271| 					this.classCount[cls] += modifier;
| 272| 272| 

binaries/data/mods/public/simulation/components/EntityLimits.js
|  89| »   »   »   for·(var·c·in·this.template.LimitRemovers[category])
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 124| »   »   if·("RequiredTechs"·in·this.removers[category]·&&·this.removers[category]["RequiredTechs"].indexOf(tech)·!==·-1)
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 136| »   »   »   nolimit·=·!this.removers[category]["RequiredTechs"].length;
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 138| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 232| »   »   var·modifier·=·1;
|    | [NORMAL] JSHintBear:
|    | 'modifier' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 257| »   for·(var·category·in·this.changers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 267| »   for·(var·category·in·this.removers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 269| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 245| »   »   this.ChangeCount(category,·modifier);
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 262| »   »   »   »   »   this.limit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 264| »   »   »   »   »   this.removedLimit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 271| »   »   »   »   »   this.classCount[cls]·+=·modifier;
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = { "context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory };
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = { "context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories() };
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 247| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(id,·IID_Identity);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'cmpIdentity' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 256| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 277| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 144| »   »   var·ret·=·cmpObstruction.CheckFoundation(passClassName,·false);
|    | [NORMAL] JSHintBear:
|    | 'ret' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 167| »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 241| »   »   var·cmpRangeManager·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_RangeManager);
|    | [NORMAL] JSHintBear:
|    | 'cmpRangeManager' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 242| »   »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 147| »   if·(ret·!=·"success")
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1503/display/redirect

Silier added inline comments.Jan 9 2020, 7:59 AM
binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_small.xml
35–37

please keep elements in alphabetic order

Nescio added inline comments.Jan 9 2020, 10:39 AM
binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_small.xml
35–37

Inside <Entity>, absolutely.
Inside <Identity>, shouldn't elements follow the order specified in the Identity.js component?

Silier resigned from this revision.Feb 19 2020, 10:06 AM
Nescio planned changes to this revision.May 13 2020, 11:15 PM
Nescio updated this revision to Diff 12696.Jul 15 2020, 3:59 PM
Nescio retitled this revision from template_structure_defensive_tower* corrections to clean up tower classes.
Nescio edited the summary of this revision. (Show Details)
Nescio removed reviewers: Silier, bb.
Nescio removed subscribers: Restricted Owners Package, Restricted Owners Package.
  • exclude file moves
  • rebased
Owners added subscribers: Restricted Owners Package, Restricted Owners Package.Jul 15 2020, 3:59 PM
Nescio added inline comments.Jul 15 2020, 4:02 PM
binaries/data/mods/public/simulation/ai/petra/baseManager.js
804

i.e. Town phase tower

binaries/data/mods/public/simulation/ai/petra/headquarters.js
1887

same as five lines above

binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
155

All towers fire projectiles by default.

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 121| 121| EntityLimits.prototype.UpdateLimitsFromTech = function(tech)
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124|    |-		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
|    | 124|+		if ("RequiredTechs" in this.removers[category] && this.removers[category].RequiredTechs.indexOf(tech) !== -1)
| 125| 125| 			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category].RequiredTechs.splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category]["RequiredTechs"].splice(this.removers[category].RequiredTechs.indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 133| 133| 	{
| 134| 134| 		var nolimit = true;
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136|    |-			nolimit = !this.removers[category]["RequiredTechs"].length;
|    | 136|+			nolimit = !this.removers[category].RequiredTechs.length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138| 138| 			for (var cls of this.removers[category]["RequiredClasses"])
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136| 136| 			nolimit = !this.removers[category]["RequiredTechs"].length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 138|+			for (var cls of this.removers[category].RequiredClasses)
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
| 140| 140| 
| 141| 141| 		if (nolimit && this.limit[category] !== undefined)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": { "category": category, "limit": this.limit[category]},
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": {"category": category, "limit": this.limit[category] },
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 266| 266| 
| 267| 267| 	for (var category in this.removers)
| 268| 268| 		if ("RequiredClasses" in this.removers[category])
| 269|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 269|+			for (var cls of this.removers[category].RequiredClasses)
| 270| 270| 				if (classes.indexOf(cls) !== -1)
| 271| 271| 					this.classCount[cls] += modifier;
| 272| 272| 

binaries/data/mods/public/simulation/components/EntityLimits.js
|  89| »   »   »   for·(var·c·in·this.template.LimitRemovers[category])
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 124| »   »   if·("RequiredTechs"·in·this.removers[category]·&&·this.removers[category]["RequiredTechs"].indexOf(tech)·!==·-1)
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 136| »   »   »   nolimit·=·!this.removers[category]["RequiredTechs"].length;
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 138| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 232| »   »   var·modifier·=·1;
|    | [NORMAL] JSHintBear:
|    | 'modifier' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 257| »   for·(var·category·in·this.changers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 267| »   for·(var·category·in·this.removers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 269| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 245| »   »   this.ChangeCount(category,·modifier);
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 262| »   »   »   »   »   this.limit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 264| »   »   »   »   »   this.removedLimit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 271| »   »   »   »   »   this.classCount[cls]·+=·modifier;
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = { "context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory };
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = { "context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories() };
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 247| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(id,·IID_Identity);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'cmpIdentity' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 256| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 277| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 144| »   »   var·ret·=·cmpObstruction.CheckFoundation(passClassName,·false);
|    | [NORMAL] JSHintBear:
|    | 'ret' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 167| »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 241| »   »   var·cmpRangeManager·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_RangeManager);
|    | [NORMAL] JSHintBear:
|    | 'cmpRangeManager' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 242| »   »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 147| »   if·(ret·!=·"success")
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2652/display/redirect

Silier requested changes to this revision.Jul 17 2020, 2:39 PM

Consistency issue:
template {civ}_defense_tower -> class StoneTower
Before it was:
template {civ}_defense_tower -> class DefenseTower
Usually there is class representing template name after {civ} so if one wants entities with that template, one can ask for that class.

binaries/data/mods/public/simulation/ai/petra/headquarters.js
1887

DefenseTower was refering to SentryTower as well and since here it is counting foundations, it is not the same as 5 lines above as SentryTower has not class StoneTower.

binaries/data/mods/public/simulation/data/technologies/tower_crenellations.json
13

why not artilery and bolt towers as well ?

binaries/data/mods/public/simulation/data/technologies/tower_range.json
14

artilery and bolt ?

binaries/data/mods/public/simulation/templates/template_structure_defensive_wall_tower.xml
57 ↗(On Diff #12696)

Breaking: hq L1869

let numTowers = gameState.getOwnEntitiesByClass("Tower", true).length;	// we count all towers, including wall towers`

Also I think wall tower not having class Tower is a bit weird as it clearly is a tower.

Breaking attackManager L478

 if (ent.hasClass("Tower") || ent.hasClass("Fortress"))
	enemyDefense++;

Breaking attackPlan L1439

targetClassesUnit = { "attack": ["Unit", "Structure"], "avoid": ["Palisade", "StoneWall", "Tower", "Fortress"], "vetoEntities": veto };
This revision now requires changes to proceed.Jul 17 2020, 2:39 PM

Consistency issue:
template {civ}_defense_tower -> class StoneTower
Before it was:
template {civ}_defense_tower -> class DefenseTower
Usually there is class representing template name after {civ} so if one wants entities with that template, one can ask for that class.

Actually classes match the shared template they're defined in. Previously:

  • template_structure_defensive_tower.xml → Tower, DefenseTower (in each of its children)

Now:

  • template_structure_defensive_tower.xml → Tower
  • template_structure_defensive_tower_artillery.xml → ArtilleryTower
  • template_structure_defensive_tower_bolt.xml → BoltTower
  • template_structure_defensive_tower_sentry.xml → SentryTower
  • template_structure_defensive_tower_stone.xml → StoneTower

For consistency and to reduce ambiguity, the initial version of this patch renamed the sentry tower (actor, icon, generic template, and class) to “Small Tower” and the stone tower to “Large Tower”. However, I reverted that because it made this patch very large and hard to review. Hence the focus on correcting only tower classes here now.

Also I think wall tower not having class Tower is a bit weird as it clearly is a tower.

Wall towers:

  • do not have template_defensive_tower.xml as their parent;
  • don't shoot any projectiles by default (other towers do);
  • are not capturable (other towers are);
  • have approximately the same health as fortresses.

Therefore I believe it makes little sense to group them with free-standing towers in a single class.

binaries/data/mods/public/simulation/ai/petra/headquarters.js
1887

Thanks for pointing that out. So change to Tower instead?

binaries/data/mods/public/simulation/data/technologies/tower_crenellations.json
13

Those are not supposed to benefit from garrisoned units. See summary.

binaries/data/mods/public/simulation/data/technologies/tower_murderholes.json
13

See summary.

binaries/data/mods/public/simulation/data/technologies/tower_range.json
14

Those don't shoot arrows. Again, see summary.

binaries/data/mods/public/simulation/data/technologies/tower_watch.json
21

See summary.

binaries/data/mods/public/simulation/templates/template_structure_defensive_wall_tower.xml
57 ↗(On Diff #12696)

Breaking: hq L1869

Does it?

Breaking attackManager L478

Thanks, I'll insert a (ent.hasClass("WallTower") || .

Breaking attackPlan L1439

WallTower is covered by StoneWall.

Nescio updated this revision to Diff 12758.Jul 17 2020, 7:10 PM
Nescio edited the summary of this revision. (Show Details)
  • fix two ai/petra lines pointed out by @Angen
  • make Defensive and Fortress classes visible
Nescio added inline comments.Jul 17 2020, 7:11 PM
binaries/data/mods/public/simulation/ai/petra/attackManager.js
478–481 ↗(On Diff #12758)

Doesn't this automatically veto Iberians with starting walls?

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = { "context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory };
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = { "context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories() };
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 247| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(id,·IID_Identity);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'cmpIdentity' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 256| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 277| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 144| »   »   var·ret·=·cmpObstruction.CheckFoundation(passClassName,·false);
|    | [NORMAL] JSHintBear:
|    | 'ret' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 167| »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 241| »   »   var·cmpRangeManager·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_RangeManager);
|    | [NORMAL] JSHintBear:
|    | 'cmpRangeManager' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 242| »   »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 147| »   if·(ret·!=·"success")
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 121| 121| EntityLimits.prototype.UpdateLimitsFromTech = function(tech)
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124|    |-		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
|    | 124|+		if ("RequiredTechs" in this.removers[category] && this.removers[category].RequiredTechs.indexOf(tech) !== -1)
| 125| 125| 			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category].RequiredTechs.splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category]["RequiredTechs"].splice(this.removers[category].RequiredTechs.indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 133| 133| 	{
| 134| 134| 		var nolimit = true;
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136|    |-			nolimit = !this.removers[category]["RequiredTechs"].length;
|    | 136|+			nolimit = !this.removers[category].RequiredTechs.length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138| 138| 			for (var cls of this.removers[category]["RequiredClasses"])
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136| 136| 			nolimit = !this.removers[category]["RequiredTechs"].length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 138|+			for (var cls of this.removers[category].RequiredClasses)
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
| 140| 140| 
| 141| 141| 		if (nolimit && this.limit[category] !== undefined)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": { "category": category, "limit": this.limit[category]},
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": {"category": category, "limit": this.limit[category] },
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 266| 266| 
| 267| 267| 	for (var category in this.removers)
| 268| 268| 		if ("RequiredClasses" in this.removers[category])
| 269|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 269|+			for (var cls of this.removers[category].RequiredClasses)
| 270| 270| 				if (classes.indexOf(cls) !== -1)
| 271| 271| 					this.classCount[cls] += modifier;
| 272| 272| 

binaries/data/mods/public/simulation/components/EntityLimits.js
|  89| »   »   »   for·(var·c·in·this.template.LimitRemovers[category])
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 124| »   »   if·("RequiredTechs"·in·this.removers[category]·&&·this.removers[category]["RequiredTechs"].indexOf(tech)·!==·-1)
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 136| »   »   »   nolimit·=·!this.removers[category]["RequiredTechs"].length;
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 138| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 232| »   »   var·modifier·=·1;
|    | [NORMAL] JSHintBear:
|    | 'modifier' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 257| »   for·(var·category·in·this.changers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 267| »   for·(var·category·in·this.removers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 269| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 245| »   »   this.ChangeCount(category,·modifier);
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 262| »   »   »   »   »   this.limit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 264| »   »   »   »   »   this.removedLimit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 271| »   »   »   »   »   this.classCount[cls]·+=·modifier;
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2689/display/redirect

Nescio updated this revision to Diff 12759.Jul 17 2020, 7:18 PM
Nescio edited the summary of this revision. (Show Details)
  • fix comment

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = { "context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory };
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = { "context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories() };
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 247| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(id,·IID_Identity);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'cmpIdentity' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 256| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 277| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 144| »   »   var·ret·=·cmpObstruction.CheckFoundation(passClassName,·false);
|    | [NORMAL] JSHintBear:
|    | 'ret' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 167| »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 241| »   »   var·cmpRangeManager·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_RangeManager);
|    | [NORMAL] JSHintBear:
|    | 'cmpRangeManager' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 242| »   »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 147| »   if·(ret·!=·"success")
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 121| 121| EntityLimits.prototype.UpdateLimitsFromTech = function(tech)
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124|    |-		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
|    | 124|+		if ("RequiredTechs" in this.removers[category] && this.removers[category].RequiredTechs.indexOf(tech) !== -1)
| 125| 125| 			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category].RequiredTechs.splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category]["RequiredTechs"].splice(this.removers[category].RequiredTechs.indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 133| 133| 	{
| 134| 134| 		var nolimit = true;
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136|    |-			nolimit = !this.removers[category]["RequiredTechs"].length;
|    | 136|+			nolimit = !this.removers[category].RequiredTechs.length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138| 138| 			for (var cls of this.removers[category]["RequiredClasses"])
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136| 136| 			nolimit = !this.removers[category]["RequiredTechs"].length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 138|+			for (var cls of this.removers[category].RequiredClasses)
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
| 140| 140| 
| 141| 141| 		if (nolimit && this.limit[category] !== undefined)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": { "category": category, "limit": this.limit[category]},
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": {"category": category, "limit": this.limit[category] },
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 266| 266| 
| 267| 267| 	for (var category in this.removers)
| 268| 268| 		if ("RequiredClasses" in this.removers[category])
| 269|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 269|+			for (var cls of this.removers[category].RequiredClasses)
| 270| 270| 				if (classes.indexOf(cls) !== -1)
| 271| 271| 					this.classCount[cls] += modifier;
| 272| 272| 

binaries/data/mods/public/simulation/components/EntityLimits.js
|  89| »   »   »   for·(var·c·in·this.template.LimitRemovers[category])
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 124| »   »   if·("RequiredTechs"·in·this.removers[category]·&&·this.removers[category]["RequiredTechs"].indexOf(tech)·!==·-1)
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 136| »   »   »   nolimit·=·!this.removers[category]["RequiredTechs"].length;
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 138| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 232| »   »   var·modifier·=·1;
|    | [NORMAL] JSHintBear:
|    | 'modifier' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 257| »   for·(var·category·in·this.changers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 267| »   for·(var·category·in·this.removers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 269| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 245| »   »   this.ChangeCount(category,·modifier);
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 262| »   »   »   »   »   this.limit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 264| »   »   »   »   »   this.removedLimit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 271| »   »   »   »   »   this.classCount[cls]·+=·modifier;
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2690/display/redirect

Nescio edited the summary of this revision. (Show Details)Jul 17 2020, 7:30 PM
Nescio added inline comments.
binaries/data/mods/public/simulation/components/Identity.js
60
  • Moved Defensive, Fortress, Tower to VisibleClasses.
  • Deleted unused GarrisonTower.
  • Inserted new WallTower.
68
  • Moved Defensive, Fortress, Tower from Classes.
  • Deleted DefenseTower.
  • Inserted new ArtilleryTower, BoltTower, StoneTower.
Nescio added inline comments.Jul 17 2020, 7:32 PM
binaries/data/mods/public/simulation/ai/petra/baseManager.js
804

Or should this too be changed to Tower?

Nescio updated this revision to Diff 12760.Jul 17 2020, 7:55 PM
  • simulation/ai/petra/headquarters.js again
Nescio edited the summary of this revision. (Show Details)Jul 17 2020, 7:57 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = { "context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory };
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = { "context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories() };
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 247| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(id,·IID_Identity);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'cmpIdentity' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 256| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 277| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 144| »   »   var·ret·=·cmpObstruction.CheckFoundation(passClassName,·false);
|    | [NORMAL] JSHintBear:
|    | 'ret' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 167| »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 241| »   »   var·cmpRangeManager·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_RangeManager);
|    | [NORMAL] JSHintBear:
|    | 'cmpRangeManager' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 242| »   »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 147| »   if·(ret·!=·"success")
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 121| 121| EntityLimits.prototype.UpdateLimitsFromTech = function(tech)
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124|    |-		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
|    | 124|+		if ("RequiredTechs" in this.removers[category] && this.removers[category].RequiredTechs.indexOf(tech) !== -1)
| 125| 125| 			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category].RequiredTechs.splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category]["RequiredTechs"].splice(this.removers[category].RequiredTechs.indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 133| 133| 	{
| 134| 134| 		var nolimit = true;
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136|    |-			nolimit = !this.removers[category]["RequiredTechs"].length;
|    | 136|+			nolimit = !this.removers[category].RequiredTechs.length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138| 138| 			for (var cls of this.removers[category]["RequiredClasses"])
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136| 136| 			nolimit = !this.removers[category]["RequiredTechs"].length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 138|+			for (var cls of this.removers[category].RequiredClasses)
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
| 140| 140| 
| 141| 141| 		if (nolimit && this.limit[category] !== undefined)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": { "category": category, "limit": this.limit[category]},
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": {"category": category, "limit": this.limit[category] },
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 266| 266| 
| 267| 267| 	for (var category in this.removers)
| 268| 268| 		if ("RequiredClasses" in this.removers[category])
| 269|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 269|+			for (var cls of this.removers[category].RequiredClasses)
| 270| 270| 				if (classes.indexOf(cls) !== -1)
| 271| 271| 					this.classCount[cls] += modifier;
| 272| 272| 

binaries/data/mods/public/simulation/components/EntityLimits.js
|  89| »   »   »   for·(var·c·in·this.template.LimitRemovers[category])
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 124| »   »   if·("RequiredTechs"·in·this.removers[category]·&&·this.removers[category]["RequiredTechs"].indexOf(tech)·!==·-1)
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 136| »   »   »   nolimit·=·!this.removers[category]["RequiredTechs"].length;
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 138| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 232| »   »   var·modifier·=·1;
|    | [NORMAL] JSHintBear:
|    | 'modifier' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 257| »   for·(var·category·in·this.changers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 267| »   for·(var·category·in·this.removers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 269| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 245| »   »   this.ChangeCount(category,·modifier);
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 262| »   »   »   »   »   this.limit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 264| »   »   »   »   »   this.removedLimit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 271| »   »   »   »   »   this.classCount[cls]·+=·modifier;
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2691/display/redirect

Silier added inline comments.Jul 17 2020, 8:23 PM
binaries/data/mods/public/simulation/ai/petra/attackManager.js
478–481 ↗(On Diff #12758)

Thats the point, to avoid well defended enemies

binaries/data/mods/public/simulation/templates/template_structure_defensive_wall_tower.xml
57 ↗(On Diff #12696)

Breaking: hq L1869

Does it?

Yes, as ai would not build sentry towers with starting wall towers which can be garrisoned in case of being attacked so it can use resources elsewhere.

Nescio added inline comments.Jul 18 2020, 11:05 AM
binaries/data/mods/public/simulation/templates/template_structure_defensive_wall_tower.xml
57 ↗(On Diff #12696)

Sorry, I still don't quite understand.
The headquarters.js file defines when to build what, right? However, the Petra AI never builds walls, so why the need to count wall towers?
(Also, I observed that builds at most 1 sentry tower.)
Furthermore, building additional towers is actually cheaper than garrisoning wall towers, since towers don't cost population, and garrisoned units can't gather or build, and are thus an economic penalty.

ai garrisones towers if they have arrow multiplier and enemy is in their attack range.
and while ai cannot build walls it can start with them.

ai garrisones towers if they have arrow multiplier and enemy is in their attack range.
and while ai cannot build walls it can start with them.

Yes, I understand that, but I don't get how that is altered by this patch.
If there is anything that should be changed, could you clarify what exactly?

Silier added inline comments.Jul 18 2020, 5:12 PM
binaries/data/mods/public/simulation/ai/petra/headquarters.js
1869

^this is the issue

Nescio updated this revision to Diff 12766.Jul 18 2020, 6:08 PM
  • Count all towers + wall towers, per @Angen.

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = { "context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory };
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = { "context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories() };
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 247| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(id,·IID_Identity);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'cmpIdentity' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 256| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 277| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 144| »   »   var·ret·=·cmpObstruction.CheckFoundation(passClassName,·false);
|    | [NORMAL] JSHintBear:
|    | 'ret' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 167| »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 241| »   »   var·cmpRangeManager·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_RangeManager);
|    | [NORMAL] JSHintBear:
|    | 'cmpRangeManager' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 242| »   »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 147| »   if·(ret·!=·"success")
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 121| 121| EntityLimits.prototype.UpdateLimitsFromTech = function(tech)
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124|    |-		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
|    | 124|+		if ("RequiredTechs" in this.removers[category] && this.removers[category].RequiredTechs.indexOf(tech) !== -1)
| 125| 125| 			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category].RequiredTechs.splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category]["RequiredTechs"].splice(this.removers[category].RequiredTechs.indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 133| 133| 	{
| 134| 134| 		var nolimit = true;
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136|    |-			nolimit = !this.removers[category]["RequiredTechs"].length;
|    | 136|+			nolimit = !this.removers[category].RequiredTechs.length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138| 138| 			for (var cls of this.removers[category]["RequiredClasses"])
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136| 136| 			nolimit = !this.removers[category]["RequiredTechs"].length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 138|+			for (var cls of this.removers[category].RequiredClasses)
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
| 140| 140| 
| 141| 141| 		if (nolimit && this.limit[category] !== undefined)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": { "category": category, "limit": this.limit[category]},
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": {"category": category, "limit": this.limit[category] },
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 266| 266| 
| 267| 267| 	for (var category in this.removers)
| 268| 268| 		if ("RequiredClasses" in this.removers[category])
| 269|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 269|+			for (var cls of this.removers[category].RequiredClasses)
| 270| 270| 				if (classes.indexOf(cls) !== -1)
| 271| 271| 					this.classCount[cls] += modifier;
| 272| 272| 

binaries/data/mods/public/simulation/components/EntityLimits.js
|  89| »   »   »   for·(var·c·in·this.template.LimitRemovers[category])
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 124| »   »   if·("RequiredTechs"·in·this.removers[category]·&&·this.removers[category]["RequiredTechs"].indexOf(tech)·!==·-1)
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 136| »   »   »   nolimit·=·!this.removers[category]["RequiredTechs"].length;
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 138| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 232| »   »   var·modifier·=·1;
|    | [NORMAL] JSHintBear:
|    | 'modifier' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 257| »   for·(var·category·in·this.changers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 267| »   for·(var·category·in·this.removers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 269| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 245| »   »   this.ChangeCount(category,·modifier);
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 262| »   »   »   »   »   this.limit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 264| »   »   »   »   »   this.removedLimit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 271| »   »   »   »   »   this.classCount[cls]·+=·modifier;
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2697/display/redirect

Silier added inline comments.Jul 18 2020, 6:43 PM
binaries/data/mods/public/simulation/templates/template_structure_defensive_tower.xml
54

I am concerned about this removal, else other things are ok.

Silier requested changes to this revision.Jul 18 2020, 6:47 PM

ERROR: RelaxNGValidator: Validation error: structures/athen_sentry_tower:1: Expecting an element BatchTimeModifier, got nothing

This revision now requires changes to proceed.Jul 18 2020, 6:47 PM
Nescio added inline comments.Jul 18 2020, 6:52 PM
binaries/data/mods/public/simulation/templates/template_structure_defensive_tower.xml
54

It's removed because towers can't train any units, therefore it has no effect at all.
However, I just looked at ProductionQueue.js and it seems <BatchTimeModifier> is not optional. Thanks for the concern.
I'll insert it in template_structure.xml, where the rest of the <ProductionQueue> is defined.

Silier added inline comments.Jul 18 2020, 6:54 PM
binaries/data/mods/public/simulation/templates/template_structure_defensive_tower.xml
54

It is for technologies as well, not just for units :)

54

^delete

Nescio updated this revision to Diff 12770.Jul 18 2020, 7:03 PM
Nescio edited the summary of this revision. (Show Details)
  • insert <BatchTimeModifier> in template_structure.xml
Silier accepted this revision.Jul 18 2020, 7:26 PM
This revision is now accepted and ready to land.Jul 18 2020, 7:26 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = { "context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 214| 214| 		result.message = markForTranslation("%(name)s cannot be built in %(territoryType)s territory. Valid territories: %(validTerritories)s");
| 215| 215| 		result.translateParameters.push("territoryType");
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217|    |-		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
|    | 217|+		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory };
| 218| 218| 		// gui code will join this array to a string
| 219| 219| 		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = { "context": "Territory type list", "list": this.GetTerritories()};
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 216| 216| 		result.translateParameters.push("validTerritories");
| 217| 217| 		result.parameters.territoryType = {"context": "Territory type", "message": invalidTerritory};
| 218| 218| 		// gui code will join this array to a string
| 219|    |-		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories()};
|    | 219|+		result.parameters.validTerritories = {"context": "Territory type list", "list": this.GetTerritories() };
| 220| 220| 		return result;	// Fail
| 221| 221| 	}
| 222| 222| 

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 247| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(id,·IID_Identity);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'cmpIdentity' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 256| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 277| »   »   »   »   let·result·=·markForPluralTranslation(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'result' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 144| »   »   var·ret·=·cmpObstruction.CheckFoundation(passClassName,·false);
|    | [NORMAL] JSHintBear:
|    | 'ret' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 167| »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 241| »   »   var·cmpRangeManager·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_RangeManager);
|    | [NORMAL] JSHintBear:
|    | 'cmpRangeManager' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 242| »   »   var·cmpPlayer·=·QueryOwnerInterface(this.entity,·IID_Player);
|    | [NORMAL] JSHintBear:
|    | 'cmpPlayer' is already defined.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 147| »   if·(ret·!=·"success")
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
| 149| »   »   switch·(ret)
|    | [NORMAL] JSHintBear:
|    | 'ret' used out of scope.
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 121| 121| EntityLimits.prototype.UpdateLimitsFromTech = function(tech)
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124|    |-		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
|    | 124|+		if ("RequiredTechs" in this.removers[category] && this.removers[category].RequiredTechs.indexOf(tech) !== -1)
| 125| 125| 			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category].RequiredTechs.splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 122| 122| {
| 123| 123| 	for (var category in this.removers)
| 124| 124| 		if ("RequiredTechs" in this.removers[category] && this.removers[category]["RequiredTechs"].indexOf(tech) !== -1)
| 125|    |-			this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech), 1);
|    | 125|+			this.removers[category]["RequiredTechs"].splice(this.removers[category].RequiredTechs.indexOf(tech), 1);
| 126| 126| 
| 127| 127| 	this.UpdateLimitRemoval();
| 128| 128| };
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredTechs"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 133| 133| 	{
| 134| 134| 		var nolimit = true;
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136|    |-			nolimit = !this.removers[category]["RequiredTechs"].length;
|    | 136|+			nolimit = !this.removers[category].RequiredTechs.length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138| 138| 			for (var cls of this.removers[category]["RequiredClasses"])
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 135| 135| 		if ("RequiredTechs" in this.removers[category])
| 136| 136| 			nolimit = !this.removers[category]["RequiredTechs"].length;
| 137| 137| 		if (nolimit && "RequiredClasses" in this.removers[category])
| 138|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 138|+			for (var cls of this.removers[category].RequiredClasses)
| 139| 139| 				nolimit = nolimit && this.classCount[cls] > 0;
| 140| 140| 
| 141| 141| 		if (nolimit && this.limit[category] !== undefined)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": { "category": category, "limit": this.limit[category]},
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 158| 158| 			"players": [cmpPlayer.GetPlayerID()],
| 159| 159| 			"translateMessage": true,
| 160| 160| 			"translateParameters": ["category"],
| 161|    |-			"parameters": {"category": category, "limit": this.limit[category]},
|    | 161|+			"parameters": {"category": category, "limit": this.limit[category] },
| 162| 162| 		};
| 163| 163| 
| 164| 164| 		if (limitType == BUILD)
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["RequiredClasses"] is better written in dot notation.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/EntityLimits.js
| 266| 266| 
| 267| 267| 	for (var category in this.removers)
| 268| 268| 		if ("RequiredClasses" in this.removers[category])
| 269|    |-			for (var cls of this.removers[category]["RequiredClasses"])
|    | 269|+			for (var cls of this.removers[category].RequiredClasses)
| 270| 270| 				if (classes.indexOf(cls) !== -1)
| 271| 271| 					this.classCount[cls] += modifier;
| 272| 272| 

binaries/data/mods/public/simulation/components/EntityLimits.js
|  89| »   »   »   for·(var·c·in·this.template.LimitRemovers[category])
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 124| »   »   if·("RequiredTechs"·in·this.removers[category]·&&·this.removers[category]["RequiredTechs"].indexOf(tech)·!==·-1)
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 125| »   »   »   this.removers[category]["RequiredTechs"].splice(this.removers[category]["RequiredTechs"].indexOf(tech),·1);
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 136| »   »   »   nolimit·=·!this.removers[category]["RequiredTechs"].length;
|    | [NORMAL] JSHintBear:
|    | ['RequiredTechs'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 138| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 232| »   »   var·modifier·=·1;
|    | [NORMAL] JSHintBear:
|    | 'modifier' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 257| »   for·(var·category·in·this.changers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 267| »   for·(var·category·in·this.removers)
|    | [NORMAL] JSHintBear:
|    | 'category' is already defined.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 269| »   »   »   for·(var·cls·of·this.removers[category]["RequiredClasses"])
|    | [NORMAL] JSHintBear:
|    | ['RequiredClasses'] is better written in dot notation.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 245| »   »   this.ChangeCount(category,·modifier);
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 262| »   »   »   »   »   this.limit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 264| »   »   »   »   »   this.removedLimit[category]·+=·modifier·*·this.changers[category][c];
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.

binaries/data/mods/public/simulation/components/EntityLimits.js
| 271| »   »   »   »   »   this.classCount[cls]·+=·modifier;
|    | [NORMAL] JSHintBear:
|    | 'modifier' used out of scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2700/display/redirect

This revision was automatically updated to reflect the committed changes.

Thanks for the review! As you noticed my understanding of Petra AI code is rather limited.
It would be great if you would be able to check and commit D2887 soon-ish. It's a small and simple patch, but it fixes some oversights, and having it committed allows me to update a few other patches.
Furthermore, I wrote a follow-up today: D2892 (clean up market and other structure classes). That one turned out quite large, so please take your time.