Page MenuHomeWildfire Games

Gameplay Scripting: Entity and Actor coding for Secondary Attacks
Needs ReviewPublic

Authored by bb on Apr 21 2017, 12:45 AM.
Tags
None
Subscribers
Restricted Owners Package, Restricted Owners Package, Restricted Owners Package, Restricted Owners Package
Tokens
"Love" token, awarded by Angen.

Details

Summary

The ancient secondary attack, or better said multiple attack, patch.

The core of this patch are the two following changes:

  1. treat "Capture" as a damageType just as Hack and such.
  2. Merge the different AttackTypes of the attack template into one, and allowing any number of them. With that comes a way to choose between the attackTypes for attacks triggered by losRangeQueries from the unitAI, this is achieved by a DPS/range calculation.

The two things above give the way to handle multiple attacks from the sim and gui, however I am not happy with the way currently commands are handled (neither the AI or players'), the way that is here implemented (with the prefAttackTypes) hardcode the attackTypes too much. In order to fix this one could think of making two arguments ("capture" and "projectile") which will prefer/exclude attackType that can/can't capture or have/haven't a projectile. This would invalidate rP19528 (while it actually was done for this patch, time has changed some ideas...) However if there are some other suggestion I am very open to those.

This patch gives the persian champion as a test case.

Patch Includes:
D2038
D2028
D2002

Test Plan

Look at the trillions of TODO in the patch, which were mostly some random thoughts I had while coding, and comment if they are wanted/required.
Decide how the user wants to choose (hotkeys like here, or more of an "on"/"off" setting per attackType)

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 8389
Build 13703: Vulcan BuildJenkins
Build 13702: arc lint + arc unit

Event Timeline

Stan created this revision.Apr 21 2017, 12:45 AM

Something that I do consider missing for this diff and ticket is something one should do with regards to ancient tickets: Figuring out if that is wanted (it is) and if what is requested is sound and complete (it isn't).

Why should we add support for secondary attacks with quite a few places hard coding that number, instead of going one step further and allow an arbitrary number of attacks in the code?

elexis edited edge metadata.Apr 21 2017, 2:28 PM

(Another thing to consider (if it hasn't already been considered) when merging the attack types is that capture isn't a typical attack, since it doesn't depend on health points)

bb edited edge metadata.Apr 21 2017, 2:42 PM
In D368#14773, @leper wrote:

Why should we add support for secondary attacks with quite a few places hard coding that number, instead of going one step further and allow an arbitrary number of attacks in the code?

The patch below indeed is outdated, I have a patch here waiting on D122 that also is less hardcoding in the number of attacks. It still doesn't allow an arbitrary number, that would require changing more or less all templates, .and there are more hardcodings all over attack.js... But the GetBestAttackAgainst function can take an arbitrary amount of attacks.
WIP attached here:

In D368#14783, @elexis wrote:

(Another thing to consider (if it hasn't already been considered) when merging the attack types is that capture isn't a typical attack, since it doesn't depend on health points)

That is a slighlty problem indeed when considering what leper said, since my WIP only allows 1 capture attack (extending that wouldn't be too hard actually, just need a good way of choosing..., some range + value check perhaps) and the choice of capture vs other attacks is pretty hardcoded (always choose capture over others).
I don't really see a way to split capture attack from the attack.js, since we don't want units to perform normal and capture attack on the same moment (and if we do, that should be in attack.js anyway). Also mods might want to add other attacktype that doesn't depend on hitpoints (stunning perhaps), and that should be disallowed of doing by our code (nor we need to code it for them).

Mh tbh I'd rather have a patch that removes the specialness of "Melee" and "Ranged" entirely in favour of arbitrarily-named attack types with arbitrary capabilities. So we could have several melee attacks depending on the enemy, or several ranged attacks. We don't have to support too fancy GUI-stuff right now but it'd be cool.

I am also suggesting tying this to Abilities (D281) for GUI support, you could click on an icon and choose a default attack or something.

fatherbushido resigned from this revision.Apr 23 2017, 6:05 PM

Who is the writer of this patch? It wasn't even rebased and is put for review?

Stan abandoned this revision.May 28 2017, 10:46 PM
Stan removed subscribers: wraitii, Lionkanzen, leper.
bb commandeered this revision.Jul 16 2019, 12:39 PM
bb edited reviewers, added: Stan; removed: bb.
bb added a reviewer: Freagarach.
bb updated this revision to Diff 8925.Jul 16 2019, 12:49 PM

Build will fail, needs to rebase last week...

Owners added subscribers: Restricted Owners Package, Restricted Owners Package, Restricted Owners Package, Restricted Owners Package.Jul 16 2019, 12:49 PM

Build failure - The Moirai have given mortals hearts that can endure.

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

bb edited the summary of this revision. (Show Details)Jul 16 2019, 1:09 PM
bb edited the test plan for this revision. (Show Details)
bb updated this revision to Diff 8926.Jul 16 2019, 1:35 PM
bb edited the test plan for this revision. (Show Details)Jul 16 2019, 1:37 PM
Angen awarded a token.Jul 16 2019, 1:41 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Armour.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Armour.js
|  42|  42|  */
|  43|  43| Armour.prototype.TakeDamage = function(playerID, strengths, multiplier = 1)
|  44|  44| {
|  45|    |-	let result = { "killed": false, "captured": false, "healthChange": 0, "captureChange": 0 }
|    |  45|+	let result = { "killed": false, "captured": false, "healthChange": 0, "captureChange": 0 };
|  46|  46| 	let damages = this.GetDamage(strengths, multiplier);
|  47|  47| 	for (let component in damages)
|  48|  48| 	{
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Armour.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Armour.js
|  53|  53| 		let cmpRecieveComponent = Engine.QueryInterface(this.entity, +component);
|  54|  54| 		if (cmpRecieveComponent)
|  55|  55| 		{
|  56|    |-			let componentResult = cmpRecieveComponent.Reduce(damages[component], playerID)
|    |  56|+			let componentResult = cmpRecieveComponent.Reduce(damages[component], playerID);
|  57|  57| 			for (let key in componentResult)
|  58|  58| 				result[key] = result[key] || componentResult[key];
|  59|  59| 		}

binaries/data/mods/public/simulation/components/Armour.js
|  45| »   let·result·=·{·"killed":·false,·"captured":·false,·"healthChange":·0,·"captureChange":·0·}
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/Armour.js
|  56| »   »   »   let·componentResult·=·cmpRecieveComponent.Reduce(damages[component],·playerID)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/maps/random/danubius_triggers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/maps/random/danubius_triggers.js
|  14|  14| 
|  15|  15| const danubiusAttackerTemplates = deepfreeze({
|  16|  16| 	"ships": TriggerHelper.GetTemplateNamesByClasses("Warship", "gaul", undefined, undefined, true),
|  17|    |-	"siege": TriggerHelper.GetTemplateNamesByClasses("Siege","gaul", undefined, undefined, true),
|    |  17|+	"siege": TriggerHelper.GetTemplateNamesByClasses("Siege", "gaul", undefined, undefined, true),
|  18|  18| 	"females": TriggerHelper.GetTemplateNamesByClasses("FemaleCitizen","gaul", undefined, undefined, true),
|  19|  19| 	"healers": TriggerHelper.GetTemplateNamesByClasses("Healer","gaul", undefined, undefined, true),
|  20|  20| 	"champions": TriggerHelper.GetTemplateNamesByClasses("Champion", "gaul", undefined, undefined, true),
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/maps/random/danubius_triggers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/maps/random/danubius_triggers.js
|  15|  15| const danubiusAttackerTemplates = deepfreeze({
|  16|  16| 	"ships": TriggerHelper.GetTemplateNamesByClasses("Warship", "gaul", undefined, undefined, true),
|  17|  17| 	"siege": TriggerHelper.GetTemplateNamesByClasses("Siege","gaul", undefined, undefined, true),
|  18|    |-	"females": TriggerHelper.GetTemplateNamesByClasses("FemaleCitizen","gaul", undefined, undefined, true),
|    |  18|+	"females": TriggerHelper.GetTemplateNamesByClasses("FemaleCitizen", "gaul", undefined, undefined, true),
|  19|  19| 	"healers": TriggerHelper.GetTemplateNamesByClasses("Healer","gaul", undefined, undefined, true),
|  20|  20| 	"champions": TriggerHelper.GetTemplateNamesByClasses("Champion", "gaul", undefined, undefined, true),
|  21|  21| 	"champion_infantry": TriggerHelper.GetTemplateNamesByClasses("Champion+Infantry", "gaul", undefined, undefined, true),
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/maps/random/danubius_triggers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/maps/random/danubius_triggers.js
|  16|  16| 	"ships": TriggerHelper.GetTemplateNamesByClasses("Warship", "gaul", undefined, undefined, true),
|  17|  17| 	"siege": TriggerHelper.GetTemplateNamesByClasses("Siege","gaul", undefined, undefined, true),
|  18|  18| 	"females": TriggerHelper.GetTemplateNamesByClasses("FemaleCitizen","gaul", undefined, undefined, true),
|  19|    |-	"healers": TriggerHelper.GetTemplateNamesByClasses("Healer","gaul", undefined, undefined, true),
|    |  19|+	"healers": TriggerHelper.GetTemplateNamesByClasses("Healer", "gaul", undefined, undefined, true),
|  20|  20| 	"champions": TriggerHelper.GetTemplateNamesByClasses("Champion", "gaul", undefined, undefined, true),
|  21|  21| 	"champion_infantry": TriggerHelper.GetTemplateNamesByClasses("Champion+Infantry", "gaul", undefined, undefined, true),
|  22|  22| 	"citizen_soldiers": TriggerHelper.GetTemplateNamesByClasses("CitizenSoldier", "gaul", undefined, "Basic", true),
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/maps/random/danubius_triggers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/maps/random/danubius_triggers.js
| 288| 288| 
| 289| 289| 		let animations = ritualAnimations[
| 290| 290| 			cmpIdentity.HasClass("Healer") ? "healer" :
| 291|    |-			cmpIdentity.HasClass("Female") ? "female" : "male"];
|    | 291|+				cmpIdentity.HasClass("Female") ? "female" : "male"];
| 292| 292| 
| 293| 293| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
| 294| 294| 		if (!cmpVisual)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 209| 209| 	}
| 210| 210| 
| 211| 211| 	for (let evt of events.Destroy)
| 212|    |-	{
|    | 212|+	
| 213| 213| 		// Let's check we haven't lost an important building here.
| 214| 214| 		if (evt && !evt.SuccessfulFoundation && evt.entityObj && evt.metadata && evt.metadata[PlayerID] &&
| 215| 215| 			evt.metadata[PlayerID].base)
| 226| 226| 			if (evt.metadata[PlayerID].baseAnchor && evt.metadata[PlayerID].baseAnchor === true)
| 227| 227| 				base.anchorLost(gameState, ent);
| 228| 228| 		}
| 229|    |-	}
|    | 229|+	
| 230| 230| 
| 231| 231| 	for (let evt of events.EntityRenamed)
| 232| 232| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 255| 255| 			// Let's get a few units from other bases there to build this.
| 256| 256| 			let builders = this.bulkPickWorkers(gameState, newbase, 10);
| 257| 257| 			if (builders !== false)
| 258|    |-			{
|    | 258|+			
| 259| 259| 				builders.forEach(worker => {
| 260| 260| 					worker.setMetadata(PlayerID, "base", newbase.ID);
| 261| 261| 					worker.setMetadata(PlayerID, "subrole", "builder");
| 262| 262| 					worker.setMetadata(PlayerID, "target-foundation", ent.id());
| 263| 263| 				});
| 264|    |-			}
|    | 264|+			
| 265| 265| 		}
| 266| 266| 		else if (ent.getMetadata(PlayerID, "base") == -2)	// anchorless base around a dock
| 267| 267| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 269| 269| 			// Let's get a few units from other bases there to build this.
| 270| 270| 			let builders = this.bulkPickWorkers(gameState, newbase, 4);
| 271| 271| 			if (builders != false)
| 272|    |-			{
|    | 272|+			
| 273| 273| 				builders.forEach(worker => {
| 274| 274| 					worker.setMetadata(PlayerID, "base", newbase.ID);
| 275| 275| 					worker.setMetadata(PlayerID, "subrole", "builder");
| 276| 276| 					worker.setMetadata(PlayerID, "target-foundation", ent.id());
| 277| 277| 				});
| 278|    |-			}
|    | 278|+			
| 279| 279| 		}
| 280| 280| 	}
| 281| 281| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 395| 395| 	}
| 396| 396| 
| 397| 397| 	for (let evt of events.TrainingFinished)
| 398|    |-	{
|    | 398|+	
| 399| 399| 		for (let entId of evt.entities)
| 400| 400| 		{
| 401| 401| 			let ent = gameState.getEntityById(entId);
| 463| 463| 					ent.moveToRange(goal[0], goal[1]);
| 464| 464| 			}
| 465| 465| 		}
| 466|    |-	}
|    | 466|+	
| 467| 467| 
| 468| 468| 	for (let evt of events.TerritoryDecayChanged)
| 469| 469| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 411| 411| 					this.garrisonManager.registerHolder(gameState, holder);
| 412| 412| 			}
| 413| 413| 			else if (ent.getMetadata(PlayerID, "garrisonType"))
| 414|    |-			{
|    | 414|+			
| 415| 415| 				// we were supposed to be autogarrisoned, but this has failed (may-be full)
| 416| 416| 				ent.setMetadata(PlayerID, "garrisonType", undefined);
| 417|    |-			}
|    | 417|+			
| 418| 418| 
| 419| 419| 			// Check if this unit is no more needed in its attack plan
| 420| 420| 			// (happen when the training ends after the attack is started or aborted)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 482| 482| 	}
| 483| 483| 
| 484| 484| 	if (addBase)
| 485|    |-	{
|    | 485|+	
| 486| 486| 		if (!this.firstBaseConfig)
| 487| 487| 		{
| 488| 488| 			// This is our first base, let us configure our starting resources
| 495| 495| 			this.saveSpace = undefined;
| 496| 496| 			this.maxFields = false;
| 497| 497| 		}
| 498|    |-	}
|    | 498|+	
| 499| 499| 
| 500| 500| 	// Then deals with decaying structures: destroy them if being lost to enemy (except in easier difficulties)
| 501| 501| 	if (this.Config.difficulty < 2)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 484| 484| 	if (addBase)
| 485| 485| 	{
| 486| 486| 		if (!this.firstBaseConfig)
| 487|    |-		{
|    | 487|+		
| 488| 488| 			// This is our first base, let us configure our starting resources
| 489| 489| 			this.configFirstBase(gameState);
| 490|    |-		}
|    | 490|+		
| 491| 491| 		else
| 492| 492| 		{
| 493| 493| 			// Let us hope this new base will fix our possible resource shortage
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 773| 773| 		let aValue = 0.1;
| 774| 774| 		let bValue = 0.1;
| 775| 775| 		for (let param of parameters)
| 776|    |-		{
|    | 776|+		
| 777| 777| 			if (param[0] == "strength")
| 778| 778| 			{
| 779| 779| 				aValue += m.getMaxStrength(a[1]) * param[1];
| 807| 807| 			}
| 808| 808| 			else
| 809| 809| 				API3.warn(" trainMoreUnits avec non prevu " + uneval(param));
| 810|    |-		}
|    | 810|+		
| 811| 811| 		return -aValue/aCost + bValue/bCost;
| 812| 812| 	});
| 813| 813| 	return units[0][0];
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|1051|1051| 				continue;
|1052|1052| 
|1053|1053| 			if (minDist > maxAccessDisfavored)     // Disfavor if quite far from any allied cc
|1054|    |-			{
|    |1054|+			
|1055|1055| 				if (!accessible)
|1056|1056| 				{
|1057|1057| 					if (minDist > maxNoAccessDisfavored)
|1061|1061| 				}
|1062|1062| 				else
|1063|1063| 					norm *= 0.5;
|1064|    |-			}
|    |1064|+			
|1065|1065| 
|1066|1066| 			// Not near any of our dropsite, except for oversea docks
|1067|1067| 			oversea = !accessible && dpList.some(dp => m.getLandAccess(gameState, dp.ent) == index);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|1053|1053| 			if (minDist > maxAccessDisfavored)     // Disfavor if quite far from any allied cc
|1054|1054| 			{
|1055|1055| 				if (!accessible)
|1056|    |-				{
|    |1056|+				
|1057|1057| 					if (minDist > maxNoAccessDisfavored)
|1058|1058| 						norm *= 0.5;
|1059|1059| 					else
|1060|1060| 						norm *= 0.8;
|1061|    |-				}
|    |1061|+				
|1062|1062| 				else
|1063|1063| 					norm *= 0.5;
|1064|1064| 			}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|1066|1066| 			// Not near any of our dropsite, except for oversea docks
|1067|1067| 			oversea = !accessible && dpList.some(dp => m.getLandAccess(gameState, dp.ent) == index);
|1068|1068| 			if (!oversea)
|1069|    |-			{
|    |1069|+			
|1070|1070| 				for (let dp of dpList)
|1071|1071| 				{
|1072|1072| 					let dist = API3.SquareVectorDistance(dp.pos, pos);
|1078|1078| 					else if (dist < 6400)
|1079|1079| 						norm *= 0.5;
|1080|1080| 				}
|1081|    |-			}
|    |1081|+			
|1082|1082| 			if (norm == 0)
|1083|1083| 				continue;
|1084|1084| 		}
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|1092|1092| 				val += gameState.sharedScript.ccResourceMaps[res].map[j];
|1093|1093| 		val *= norm;
|1094|1094| 
|1095|    |-		// If oversea, be just above threshold to be accepted if nothing else 
|    |1095|+		// If oversea, be just above threshold to be accepted if nothing else
|1096|1096| 		if (oversea)
|1097|1097| 			val = Math.max(val, cut + 0.1);
|1098|1098| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|1378|1378| 	// do not keep it if gain is too small, except if this is our first BarterMarket
|1379|1379| 	let idx;
|1380|1380| 	if (expectedGain < this.tradeManager.minimalGain)
|1381|    |-	{
|    |1381|+	
|1382|1382| 		if (template.hasClass("BarterMarket") &&
|1383|1383| 		    !gameState.getOwnEntitiesByClass("BarterMarket", true).hasEntities())
|1384|1384| 			idx = -1;	// needed by queueplanBuilding manager to keep that market
|1385|1385| 		else
|1386|1386| 			return false;
|1387|    |-	}
|    |1387|+	
|1388|1388| 	else
|1389|1389| 		idx = this.basesMap.map[bestJdx];
|1390|1390| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|1565|1565| 			let cost = queues.economicBuilding.plans[0].getCost();
|1566|1566| 			queueManager.setAccounts(gameState, cost, "economicBuilding");
|1567|1567| 			if (!queueManager.canAfford("economicBuilding", cost))
|1568|    |-			{
|    |1568|+			
|1569|1569| 				for (let q in queueManager.queues)
|1570|1570| 				{
|1571|1571| 					if (q == "economicBuilding")
|1574|1574| 					if (queueManager.canAfford("economicBuilding", cost))
|1575|1575| 						break;
|1576|1576| 				}
|1577|    |-			}
|    |1577|+			
|1578|1578| 		}
|1579|1579| 		return;
|1580|1580| 	}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|1624|1624| 		let highLevel = 0;
|1625|1625| 		let lowLevel = 0;
|1626|1626| 		for (let res in cost)
|1627|    |-		{
|    |1627|+		
|1628|1628| 			if (resources[res] && resources[res] > 0.7 * cost[res])
|1629|1629| 				++highLevel;
|1630|1630| 			else if (!resources[res] || resources[res] < 0.3 * cost[res])
|1631|1631| 				++lowLevel;
|1632|    |-		}
|    |1632|+		
|1633|1633| 		if (highLevel == 0 || lowLevel > 1)
|1634|1634| 			return;
|1635|1635| 	}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|1750|1750| 	let freeSlots = gameState.getPopulationLimit() + HouseNb*popBonus - this.getAccountedPopulation(gameState);
|1751|1751| 	let priority;
|1752|1752| 	if (freeSlots < 5)
|1753|    |-	{
|    |1753|+	
|1754|1754| 		if (this.buildManager.isUnbuildable(gameState, house))
|1755|1755| 		{
|1756|1756| 			if (this.Config.debug > 1)
|1759|1759| 		}
|1760|1760| 		else
|1761|1761| 			priority = 2*this.Config.priorities.house;
|1762|    |-	}
|    |1762|+	
|1763|1763| 	else
|1764|1764| 		priority = this.Config.priorities.house;
|1765|1765| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|1841|1841| 		return;
|1842|1842| 
|1843|1843| 	if (!this.saveResources && (this.currentPhase > 2 || gameState.isResearching(gameState.getPhaseName(3))))
|1844|    |-	{
|    |1844|+	
|1845|1845| 		// try to build fortresses
|1846|1846| 		if (this.canBuild(gameState, "structures/{civ}_fortress"))
|1847|1847| 		{
|1860|1860| 				return;
|1861|1861| 			}
|1862|1862| 		}
|1863|    |-	}
|    |1863|+	
|1864|1864| 
|1865|1865| 	if (this.Config.Military.numSentryTowers && this.currentPhase < 2 && this.canBuild(gameState, "structures/{civ}_sentry_tower"))
|1866|1866| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|2004|2004| 		nAdvanced += gameState.countEntitiesAndQueuedByType(advanced, true);
|2005|2005| 
|2006|2006| 	if (!nAdvanced || nAdvanced < this.bAdvanced.length && this.getAccountedPopulation(gameState) > 110)
|2007|    |-	{
|    |2007|+	
|2008|2008| 		for (let advanced of this.bAdvanced)
|2009|2009| 		{
|2010|2010| 			if (gameState.countEntitiesAndQueuedByType(advanced, true) > 0 || !this.canBuild(gameState, advanced))
|2019|2019| 				queues.militaryBuilding.addPlan(new m.ConstructionPlan(gameState, advanced));
|2020|2020| 			return;
|2021|2021| 		}
|2022|    |-	}
|    |2022|+	
|2023|2023| };
|2024|2024| 
|2025|2025| /**
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|2107|2107| 	// in which case we prefer melee units
|2108|2108| 	let numGarrisoned = this.garrisonManager.numberOfGarrisonedUnits(nearestAnchor);
|2109|2109| 	if (nearestAnchor._entity.trainingQueue)
|2110|    |-	{
|    |2110|+	
|2111|2111| 		for (let item of nearestAnchor._entity.trainingQueue)
|2112|2112| 		{
|2113|2113| 			if (item.metadata && item.metadata.garrisonType)
|2115|2115| 			else if (!item.progress && (!item.metadata || !item.metadata.trainer))
|2116|2116| 				nearestAnchor.stopProduction(item.id);
|2117|2117| 		}
|2118|    |-	}
|    |2118|+	
|2119|2119| 	let autogarrison = numGarrisoned < nearestAnchor.garrisonMax() &&
|2120|2120| 	                   nearestAnchor.hitpoints() > nearestAnchor.garrisonEjectHealth() * nearestAnchor.maxHitpoints();
|2121|2121| 	let rangedWanted = randBool() && autogarrison;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|2109|2109| 	if (nearestAnchor._entity.trainingQueue)
|2110|2110| 	{
|2111|2111| 		for (let item of nearestAnchor._entity.trainingQueue)
|2112|    |-		{
|    |2112|+		
|2113|2113| 			if (item.metadata && item.metadata.garrisonType)
|2114|2114| 				numGarrisoned += item.count;
|2115|2115| 			else if (!item.progress && (!item.metadata || !item.metadata.trainer))
|2116|2116| 				nearestAnchor.stopProduction(item.id);
|2117|    |-		}
|    |2117|+		
|2118|2118| 	}
|2119|2119| 	let autogarrison = numGarrisoned < nearestAnchor.garrisonMax() &&
|2120|2120| 	                   nearestAnchor.hitpoints() > nearestAnchor.garrisonEjectHealth() * nearestAnchor.maxHitpoints();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|2149|2149| 	let cost = new API3.Resources(templateFound[1].cost());
|2150|2150| 	queueManager.setAccounts(gameState, cost, "emergency");
|2151|2151| 	if (!queueManager.canAfford("emergency", cost))
|2152|    |-	{
|    |2152|+	
|2153|2153| 		for (let q in queueManager.queues)
|2154|2154| 		{
|2155|2155| 			if (q == "emergency")
|2158|2158| 			if (queueManager.canAfford("emergency", cost))
|2159|2159| 				break;
|2160|2160| 		}
|2161|    |-	}
|    |2161|+	
|2162|2162| 	let metadata = { "role": "worker", "base": nearestAnchor.getMetadata(PlayerID, "base"), "plan": -1, "trainer": nearestAnchor.id() };
|2163|2163| 	if (autogarrison)
|2164|2164| 		metadata.garrisonType = "protection";
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|2439|2439| m.HQ.prototype.assignGatherers = function()
|2440|2440| {
|2441|2441| 	for (let base of this.baseManagers)
|2442|    |-	{
|    |2442|+	
|2443|2443| 		for (let worker of base.workers.values())
|2444|2444| 		{
|2445|2445| 			if (worker.unitAIState().split(".")[1] != "RETURNRESOURCE")
|2449|2449| 				continue;
|2450|2450| 			this.AddTCGatherer(orders[1].target);
|2451|2451| 		}
|2452|    |-	}
|    |2452|+	
|2453|2453| };
|2454|2454| 
|2455|2455| m.HQ.prototype.isDangerousLocation = function(gameState, pos, radius)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|2620|2620| 	{
|2621|2621| 		let pop = gameState.getPopulation();
|2622|2622| 		for (let ent of gameState.getOwnTrainingFacilities().values())
|2623|    |-		{
|    |2623|+		
|2624|2624| 			for (let item of ent.trainingQueue())
|2625|2625| 			{
|2626|2626| 				if (!item.unitTemplate)
|2629|2629| 				if (unitPop)
|2630|2630| 					pop += item.count * unitPop;
|2631|2631| 			}
|2632|    |-		}
|    |2632|+		
|2633|2633| 		this.turnCache.accountedPopulation = pop;
|2634|2634| 	}
|2635|2635| 	return this.turnCache.accountedPopulation;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|2644|2644| 	{
|2645|2645| 		let workers = gameState.getOwnEntitiesByRole("worker", true).length;
|2646|2646| 		for (let ent of gameState.getOwnTrainingFacilities().values())
|2647|    |-		{
|    |2647|+		
|2648|2648| 			for (let item of ent.trainingQueue())
|2649|2649| 			{
|2650|2650| 				if (!item.metadata || !item.metadata.role || item.metadata.role != "worker")
|2651|2651| 					continue;
|2652|2652| 				workers += item.count;
|2653|2653| 			}
|2654|    |-		}
|    |2654|+		
|2655|2655| 		this.turnCache.accountedWorkers = workers;
|2656|2656| 	}
|2657|2657| 	return this.turnCache.accountedWorkers;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 0.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|2682|2682| 			this.phasing = 0;
|2683|2683| 	}
|2684|2684| 
|2685|    |-/*	if (this.Config.debug > 1)
|    |2685|+	/*	if (this.Config.debug > 1)
|2686|2686| 	{
|2687|2687| 		gameState.getOwnUnits().forEach (function (ent) {
|2688|2688| 			if (!ent.position())
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 0.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js
|2757|2757| 		this.currentBase %= this.baseManagers.length;
|2758|2758| 		activeBase = this.baseManagers[this.currentBase++].update(gameState, queues, events);
|2759|2759| 		--nbBases;
|2760|    |-// TODO what to do with this.reassignTerritories(this.baseManagers[this.currentBase]);
|    |2760|+		// TODO what to do with this.reassignTerritories(this.baseManagers[this.currentBase]);
|2761|2761| 	}
|2762|2762| 	while (!activeBase && nbBases != 0);
|2763|2763| 

binaries/data/mods/public/simulation/ai/petra/headquarters.js
|2895| }(PETRA);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'PETRA' was used before it was defined.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Attack.js
| 272| 272| 	let cmpTargetPosition = Engine.QueryInterface(target, IID_Position);
| 273| 273| 	if (!cmpThisPosition || !cmpTargetPosition || !cmpThisPosition.IsInWorld() || !cmpTargetPosition.IsInWorld())
| 274| 274| 		return [];
| 275|    |-	let isTurret = cmpThisPosition.GetTurretParent() != INVALID_ENTITY
|    | 275|+	let isTurret = cmpThisPosition.GetTurretParent() != INVALID_ENTITY;
| 276| 276| 
| 277| 277| 	let cmpTargetIdentity = QueryMiragedInterface(target, IID_Identity);
| 278| 278| 	if (!cmpTargetIdentity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Attack.js
| 293| 293| 	let heightDiff = Math.abs(cmpThisPosition.GetHeightOffset() - cmpTargetPosition.GetHeightOffset());
| 294| 294| 
| 295| 295| 	return types.filter(type => {
| 296|    |-		//TODO splash?
|    | 296|+		// TODO splash?
| 297| 297| 		if (Object.keys(this.template[type].Damage).every(damageType => {
| 298| 298| 			if (!this.template[type].Damage[damageType])
| 299| 299| 				return true;
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Attack.js
| 427| 427| 			bestDPSRange = DPSRange;
| 428| 428| 		}
| 429| 429| 	}
| 430|    |-	return bestType
|    | 430|+	return bestType;
| 431| 431| };
| 432| 432| 
| 433| 433| Attack.prototype.CompareEntitiesByPreference = function(a, b)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Attack.js
| 562| 562| 
| 563| 563| 		let horizSpeed = +this.template[type].Projectile.Speed;
| 564| 564| 		let gravity = +this.template[type].Projectile.Gravity;
| 565|    |-		//horizSpeed /= 2; gravity /= 2; // slow it down for testing
|    | 565|+		// horizSpeed /= 2; gravity /= 2; // slow it down for testing
| 566| 566| 
| 567| 567| 		let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 568| 568| 		if (!cmpPosition || !cmpPosition.IsInWorld())
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Attack.js
| 611| 611| 		// TODO: Use unit rotation to implement x/z offsets.
| 612| 612| 		let deltaLaunchPoint = new Vector3D(0, this.template[type].Projectile.LaunchPoint["@y"], 0.0);
| 613| 613| 		let launchPoint = Vector3D.add(selfPosition, deltaLaunchPoint);
| 614|    |-		
|    | 614|+
| 615| 615| 		let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
| 616| 616| 		if (cmpVisual)
| 617| 617| 		{
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Attack.js
| 625| 625| 				launchPoint = visualActorLaunchPoint;
| 626| 626| 		}
| 627| 627| 
| 628|    |-		data.projectileId = cmpProjectileManager.LaunchProjectileAtPoint(launchPoint, realTargetPosition, horizSpeed, gravity, actorName, impactActorName, impactAnimationLifetime)
|    | 628|+		data.projectileId = cmpProjectileManager.LaunchProjectileAtPoint(launchPoint, realTargetPosition, horizSpeed, gravity, actorName, impactActorName, impactAnimationLifetime);
| 629| 629| 
| 630| 630| 		let attackImpactSound = "";
| 631| 631| 		let cmpSound = Engine.QueryInterface(this.entity, IID_Sound);

binaries/data/mods/public/simulation/components/Attack.js
| 295| »   return·types.filter(type·=>·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of arrow function.

binaries/data/mods/public/simulation/components/Attack.js
| 530| ·»   let·cmpDamage·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_Damage);
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/components/Attack.js
| 275| »   let·isTurret·=·cmpThisPosition.GetTurretParent()·!=·INVALID_ENTITY
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/Attack.js
| 430| »   return·bestType
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/Attack.js
| 628| »   »   data.projectileId·=·cmpProjectileManager.LaunchProjectileAtPoint(launchPoint,·realTargetPosition,·horizSpeed,·gravity,·actorName,·impactActorName,·impactAnimationLifetime)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/Attack.js
| 634| »   »   cmpTimer.SetTimeout(SYSTEM_ENTITY,·IID_Damage,·"MissileHit",·timeToTarget·*·1000·+·+(this.template[type].Delay·||·0),·data);
|    | [NORMAL] JSHintBear:
|    | Confusing plusses.
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Mirage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Mirage.js
| 131| 131| Mirage.prototype.GetCapturePoints = function() { return this.capturePoints; };
| 132| 132| 
| 133| 133| Mirage.prototype.CanCapture = Capturable.prototype.CanCapture;
| 134|    |-//TODO stop dupli
|    | 134|+// TODO stop dupli
| 135| 135| Mirage.prototype.CanAttack = Capturable.prototype.CanAttack;
| 136| 136| 
| 137| 137| // Armour data
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Mirage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Mirage.js
| 141| 141| 	this.armourStrengths = cmpDamageReceiver.GetArmourStrengths();
| 142| 142| };
| 143| 143| 
| 144|    |-Mirage.prototype.GetArmourStrengths = function() { return this.armourStrengths };
|    | 144|+Mirage.prototype.GetArmourStrengths = function() { return this.armourStrengths; };
| 145| 145| Mirage.prototype.GetDamage = Armour.prototype.GetDamage;
| 146| 146| 
| 147| 147| // ResourceSupply data

binaries/data/mods/public/simulation/components/Mirage.js
| 144| Mirage.prototype.GetArmourStrengths·=·function()·{·return·this.armourStrengths·};
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetInterval' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  35|  35| 
|  36|  36| 
|  37|  37| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
|  38|    |-		SetInterval: function() { },
|    |  38|+		"SetInterval": function() { },
|  39|  39| 		SetTimeout: function() { },
|  40|  40| 	});
|  41|  41| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetTimeout' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  36|  36| 
|  37|  37| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
|  38|  38| 		SetInterval: function() { },
|  39|    |-		SetTimeout: function() { },
|    |  39|+		"SetTimeout": function() { },
|  40|  40| 	});
|  41|  41| 
|  42|  42| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CreateActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  40|  40| 	});
|  41|  41| 
|  42|  42| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
|  43|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    |  43|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
|  44|  44| 			return 1;
|  45|  45| 		},
|  46|  46| 		EnableActiveQuery: function(id) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'EnableActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  43|  43| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|  44|  44| 			return 1;
|  45|  45| 		},
|  46|    |-		EnableActiveQuery: function(id) { },
|    |  46|+		"EnableActiveQuery": function(id) { },
|  47|  47| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|  48|  48| 		DisableActiveQuery: function(id) { },
|  49|  49| 		GetEntityFlagMask: function(identifier) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'ResetActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  44|  44| 			return 1;
|  45|  45| 		},
|  46|  46| 		EnableActiveQuery: function(id) { },
|  47|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    |  47|+		"ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; },
|  48|  48| 		DisableActiveQuery: function(id) { },
|  49|  49| 		GetEntityFlagMask: function(identifier) { },
|  50|  50| 	});
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  44|  44| 			return 1;
|  45|  45| 		},
|  46|  46| 		EnableActiveQuery: function(id) { },
|  47|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    |  47|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
|  48|  48| 		DisableActiveQuery: function(id) { },
|  49|  49| 		GetEntityFlagMask: function(identifier) { },
|  50|  50| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'DisableActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  45|  45| 		},
|  46|  46| 		EnableActiveQuery: function(id) { },
|  47|  47| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|  48|    |-		DisableActiveQuery: function(id) { },
|    |  48|+		"DisableActiveQuery": function(id) { },
|  49|  49| 		GetEntityFlagMask: function(identifier) { },
|  50|  50| 	});
|  51|  51| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEntityFlagMask' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  46|  46| 		EnableActiveQuery: function(id) { },
|  47|  47| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|  48|  48| 		DisableActiveQuery: function(id) { },
|  49|    |-		GetEntityFlagMask: function(identifier) { },
|    |  49|+		"GetEntityFlagMask": function(identifier) { },
|  50|  50| 	});
|  51|  51| 
|  52|  52| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetCurrentTemplateName' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  50|  50| 	});
|  51|  51| 
|  52|  52| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
|  53|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    |  53|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
|  54|  54| 	});
|  55|  55| 
|  56|  56| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPlayerByID' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  54|  54| 	});
|  55|  55| 
|  56|  56| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|  57|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    |  57|+		"GetPlayerByID": function(id) { return playerEntity; },
|  58|  58| 		GetNumPlayers: function() { return 2; },
|  59|  59| 	});
|  60|  60| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetNumPlayers' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  55|  55| 
|  56|  56| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|  57|  57| 		GetPlayerByID: function(id) { return playerEntity; },
|  58|    |-		GetNumPlayers: function() { return 2; },
|    |  58|+		"GetNumPlayers": function() { return 2; },
|  59|  59| 	});
|  60|  60| 
|  61|  61| 	AddMock(playerEntity, IID_Player, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsAlly' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  59|  59| 	});
|  60|  60| 
|  61|  61| 	AddMock(playerEntity, IID_Player, {
|  62|    |-		IsAlly: function() { return false; },
|    |  62|+		"IsAlly": function() { return false; },
|  63|  63| 		IsEnemy: function() { return true; },
|  64|  64| 		GetEnemies: function() { return []; },
|  65|  65| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsEnemy' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  60|  60| 
|  61|  61| 	AddMock(playerEntity, IID_Player, {
|  62|  62| 		IsAlly: function() { return false; },
|  63|    |-		IsEnemy: function() { return true; },
|    |  63|+		"IsEnemy": function() { return true; },
|  64|  64| 		GetEnemies: function() { return []; },
|  65|  65| 	});
|  66|  66| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEnemies' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  61|  61| 	AddMock(playerEntity, IID_Player, {
|  62|  62| 		IsAlly: function() { return false; },
|  63|  63| 		IsEnemy: function() { return true; },
|  64|    |-		GetEnemies: function() { return []; },
|    |  64|+		"GetEnemies": function() { return []; },
|  65|  65| 	});
|  66|  66| 
|  67|  67| 	AddMock(SYSTEM_ENTITY, IID_ObstructionManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetClassesList' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  71|  71| 	var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
|  72|  72| 
|  73|  73| 	AddMock(unit, IID_Identity, {
|  74|    |-		GetClassesList: function() { return []; },
|    |  74|+		"GetClassesList": function() { return []; },
|  75|  75| 	});
|  76|  76| 
|  77|  77| 	AddMock(unit, IID_Ownership, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetOwner' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  75|  75| 	});
|  76|  76| 
|  77|  77| 	AddMock(unit, IID_Ownership, {
|  78|    |-		GetOwner: function() { return 1; },
|    |  78|+		"GetOwner": function() { return 1; },
|  79|  79| 	});
|  80|  80| 
|  81|  81| 	AddMock(unit, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  79|  79| 	});
|  80|  80| 
|  81|  81| 	AddMock(unit, IID_Position, {
|  82|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    |  82|+		"GetTurretParent": function() { return INVALID_ENTITY; },
|  83|  83| 		GetPosition: function() { return new Vector3D(); },
|  84|  84| 		GetPosition2D: function() { return new Vector2D(); },
|  85|  85| 		GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  80|  80| 
|  81|  81| 	AddMock(unit, IID_Position, {
|  82|  82| 		GetTurretParent: function() { return INVALID_ENTITY; },
|  83|    |-		GetPosition: function() { return new Vector3D(); },
|    |  83|+		"GetPosition": function() { return new Vector3D(); },
|  84|  84| 		GetPosition2D: function() { return new Vector2D(); },
|  85|  85| 		GetRotation: function() { return { "y": 0 }; },
|  86|  86| 		IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  81|  81| 	AddMock(unit, IID_Position, {
|  82|  82| 		GetTurretParent: function() { return INVALID_ENTITY; },
|  83|  83| 		GetPosition: function() { return new Vector3D(); },
|  84|    |-		GetPosition2D: function() { return new Vector2D(); },
|    |  84|+		"GetPosition2D": function() { return new Vector2D(); },
|  85|  85| 		GetRotation: function() { return { "y": 0 }; },
|  86|  86| 		IsInWorld: function() { return true; },
|  87|  87| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  82|  82| 		GetTurretParent: function() { return INVALID_ENTITY; },
|  83|  83| 		GetPosition: function() { return new Vector3D(); },
|  84|  84| 		GetPosition2D: function() { return new Vector2D(); },
|  85|    |-		GetRotation: function() { return { "y": 0 }; },
|    |  85|+		"GetRotation": function() { return { "y": 0 }; },
|  86|  86| 		IsInWorld: function() { return true; },
|  87|  87| 	});
|  88|  88| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  83|  83| 		GetPosition: function() { return new Vector3D(); },
|  84|  84| 		GetPosition2D: function() { return new Vector2D(); },
|  85|  85| 		GetRotation: function() { return { "y": 0 }; },
|  86|    |-		IsInWorld: function() { return true; },
|    |  86|+		"IsInWorld": function() { return true; },
|  87|  87| 	});
|  88|  88| 
|  89|  89| 	AddMock(unit, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  95|  95| 	});
|  96|  96| 
|  97|  97| 	AddMock(unit, IID_Vision, {
|  98|    |-		GetRange: function() { return 10; },
|    |  98|+		"GetRange": function() { return 10; },
|  99|  99| 	});
| 100| 100| 
| 101| 101| 	AddMock(unit, IID_Attack, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  99|  99| 	});
| 100| 100| 
| 101| 101| 	AddMock(unit, IID_Attack, {
| 102|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 102|+		"GetRange": function() { return { "max": 10, "min": 0}; },
| 103| 103| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 104| 104| 		GetBestAttackAgainst: function(t) { return "Melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  99|  99| 	});
| 100| 100| 
| 101| 101| 	AddMock(unit, IID_Attack, {
| 102|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 102|+		GetRange: function() { return { "max": 10, "min": 0 }; },
| 103| 103| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 104| 104| 		GetBestAttackAgainst: function(t) { return "Melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetFullAttackRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 100| 100| 
| 101| 101| 	AddMock(unit, IID_Attack, {
| 102| 102| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 103|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 103|+		"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 104| 104| 		GetBestAttackAgainst: function(t) { return "Melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
| 106| 106| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 100| 100| 
| 101| 101| 	AddMock(unit, IID_Attack, {
| 102| 102| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 103|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 103|+		GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 104| 104| 		GetBestAttackAgainst: function(t) { return "Melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
| 106| 106| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetBestAttackAgainst' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 101| 101| 	AddMock(unit, IID_Attack, {
| 102| 102| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 103| 103| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 104|    |-		GetBestAttackAgainst: function(t) { return "Melee"; },
|    | 104|+		"GetBestAttackAgainst": function(t) { return "Melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
| 106| 106| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 107| 107| 		CanAttack: function(v) { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPreference' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 102| 102| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 103| 103| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 104| 104| 		GetBestAttackAgainst: function(t) { return "Melee"; },
| 105|    |-		GetPreference: function(t) { return 0; },
|    | 105|+		"GetPreference": function(t) { return 0; },
| 106| 106| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 107| 107| 		CanAttack: function(v) { return true; },
| 108| 108| 		CompareEntitiesByPreference: function(a, b) { return 0; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTimers' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 103| 103| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 104| 104| 		GetBestAttackAgainst: function(t) { return "Melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
| 106|    |-		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 106|+		"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 107| 107| 		CanAttack: function(v) { return true; },
| 108| 108| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 109| 109| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CanAttack' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 104| 104| 		GetBestAttackAgainst: function(t) { return "Melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
| 106| 106| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 107|    |-		CanAttack: function(v) { return true; },
|    | 107|+		"CanAttack": function(v) { return true; },
| 108| 108| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 109| 109| 	});
| 110| 110| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CompareEntitiesByPreference' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 105| 105| 		GetPreference: function(t) { return 0; },
| 106| 106| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 107| 107| 		CanAttack: function(v) { return true; },
| 108|    |-		CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 108|+		"CompareEntitiesByPreference": function(a, b) { return 0; },
| 109| 109| 	});
| 110| 110| 
| 111| 111| 	unitAI.OnCreate();
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetHitpoints' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 116| 116| 	if (mode == 1)
| 117| 117| 	{
| 118| 118| 		AddMock(enemy, IID_Health, {
| 119|    |-			GetHitpoints: function() { return 10; },
|    | 119|+			"GetHitpoints": function() { return 10; },
| 120| 120| 		});
| 121| 121| 		AddMock(enemy, IID_UnitAI, {
| 122| 122| 			IsAnimal: function() { return false; }
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsAnimal' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 119| 119| 			GetHitpoints: function() { return 10; },
| 120| 120| 		});
| 121| 121| 		AddMock(enemy, IID_UnitAI, {
| 122|    |-			IsAnimal: function() { return false; }
|    | 122|+			"IsAnimal": function() { return false; }
| 123| 123| 		});
| 124| 124| 	}
| 125| 125| 	else if (mode == 2)
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetHitpoints' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 124| 124| 	}
| 125| 125| 	else if (mode == 2)
| 126| 126| 		AddMock(enemy, IID_Health, {
| 127|    |-			GetHitpoints: function() { return 0; },
|    | 127|+			"GetHitpoints": function() { return 0; },
| 128| 128| 		});
| 129| 129| 
| 130| 130| 	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 127| 127| 			GetHitpoints: function() { return 0; },
| 128| 128| 		});
| 129| 129| 
| 130|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 130|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 131| 131| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 132| 132| 
| 133| 133| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 127| 127| 			GetHitpoints: function() { return 0; },
| 128| 128| 		});
| 129| 129| 
| 130|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 130|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 131| 131| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 132| 132| 
| 133| 133| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'JumpTo' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 131| 131| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 132| 132| 
| 133| 133| 	AddMock(controller, IID_Position, {
| 134|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 134|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 135| 135| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 136| 136| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 137| 137| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 132| 132| 
| 133| 133| 	AddMock(controller, IID_Position, {
| 134| 134| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 135|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 135|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 136| 136| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 137| 137| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 138| 138| 		GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 133| 133| 	AddMock(controller, IID_Position, {
| 134| 134| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 135| 135| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 136|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 136|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 137| 137| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 138| 138| 		GetRotation: function() { return { "y": 0 }; },
| 139| 139| 		IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 134| 134| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 135| 135| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 136| 136| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 137|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 137|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 138| 138| 		GetRotation: function() { return { "y": 0 }; },
| 139| 139| 		IsInWorld: function() { return true; },
| 140| 140| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 135| 135| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 136| 136| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 137| 137| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 138|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 138|+		"GetRotation": function() { return { "y": 0 }; },
| 139| 139| 		IsInWorld: function() { return true; },
| 140| 140| 	});
| 141| 141| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 136| 136| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 137| 137| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 138| 138| 		GetRotation: function() { return { "y": 0 }; },
| 139|    |-		IsInWorld: function() { return true; },
|    | 139|+		"IsInWorld": function() { return true; },
| 140| 140| 	});
| 141| 141| 
| 142| 142| 	AddMock(controller, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetInterval' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 186| 186| 	var unitAIs = [];
| 187| 187| 
| 188| 188| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 189|    |-		SetInterval: function() { },
|    | 189|+		"SetInterval": function() { },
| 190| 190| 		SetTimeout: function() { },
| 191| 191| 	});
| 192| 192| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetTimeout' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 187| 187| 
| 188| 188| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 189| 189| 		SetInterval: function() { },
| 190|    |-		SetTimeout: function() { },
|    | 190|+		"SetTimeout": function() { },
| 191| 191| 	});
| 192| 192| 
| 193| 193| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CreateActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 192| 192| 
| 193| 193| 
| 194| 194| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 195|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 195|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 196| 196| 			return 1;
| 197| 197| 		},
| 198| 198| 		EnableActiveQuery: function(id) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'EnableActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 195| 195| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 196| 196| 			return 1;
| 197| 197| 		},
| 198|    |-		EnableActiveQuery: function(id) { },
|    | 198|+		"EnableActiveQuery": function(id) { },
| 199| 199| 		ResetActiveQuery: function(id) { return [enemy]; },
| 200| 200| 		DisableActiveQuery: function(id) { },
| 201| 201| 		GetEntityFlagMask: function(identifier) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'ResetActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 196| 196| 			return 1;
| 197| 197| 		},
| 198| 198| 		EnableActiveQuery: function(id) { },
| 199|    |-		ResetActiveQuery: function(id) { return [enemy]; },
|    | 199|+		"ResetActiveQuery": function(id) { return [enemy]; },
| 200| 200| 		DisableActiveQuery: function(id) { },
| 201| 201| 		GetEntityFlagMask: function(identifier) { },
| 202| 202| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'DisableActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 197| 197| 		},
| 198| 198| 		EnableActiveQuery: function(id) { },
| 199| 199| 		ResetActiveQuery: function(id) { return [enemy]; },
| 200|    |-		DisableActiveQuery: function(id) { },
|    | 200|+		"DisableActiveQuery": function(id) { },
| 201| 201| 		GetEntityFlagMask: function(identifier) { },
| 202| 202| 	});
| 203| 203| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEntityFlagMask' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 198| 198| 		EnableActiveQuery: function(id) { },
| 199| 199| 		ResetActiveQuery: function(id) { return [enemy]; },
| 200| 200| 		DisableActiveQuery: function(id) { },
| 201|    |-		GetEntityFlagMask: function(identifier) { },
|    | 201|+		"GetEntityFlagMask": function(identifier) { },
| 202| 202| 	});
| 203| 203| 
| 204| 204| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetCurrentTemplateName' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 202| 202| 	});
| 203| 203| 
| 204| 204| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 205|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 205|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 206| 206| 	});
| 207| 207| 
| 208| 208| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPlayerByID' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 206| 206| 	});
| 207| 207| 
| 208| 208| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 209|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 209|+		"GetPlayerByID": function(id) { return playerEntity; },
| 210| 210| 		GetNumPlayers: function() { return 2; },
| 211| 211| 	});
| 212| 212| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetNumPlayers' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 207| 207| 
| 208| 208| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 209| 209| 		GetPlayerByID: function(id) { return playerEntity; },
| 210|    |-		GetNumPlayers: function() { return 2; },
|    | 210|+		"GetNumPlayers": function() { return 2; },
| 211| 211| 	});
| 212| 212| 
| 213| 213| 	AddMock(SYSTEM_ENTITY, IID_ObstructionManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsAlly' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 215| 215| 	});
| 216| 216| 
| 217| 217| 	AddMock(playerEntity, IID_Player, {
| 218|    |-		IsAlly: function() { return false; },
|    | 218|+		"IsAlly": function() { return false; },
| 219| 219| 		IsEnemy: function() { return true; },
| 220| 220| 		GetEnemies: function() { return []; },
| 221| 221| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsEnemy' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 216| 216| 
| 217| 217| 	AddMock(playerEntity, IID_Player, {
| 218| 218| 		IsAlly: function() { return false; },
| 219|    |-		IsEnemy: function() { return true; },
|    | 219|+		"IsEnemy": function() { return true; },
| 220| 220| 		GetEnemies: function() { return []; },
| 221| 221| 	});
| 222| 222| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEnemies' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 217| 217| 	AddMock(playerEntity, IID_Player, {
| 218| 218| 		IsAlly: function() { return false; },
| 219| 219| 		IsEnemy: function() { return true; },
| 220|    |-		GetEnemies: function() { return []; },
|    | 220|+		"GetEnemies": function() { return []; },
| 221| 221| 	});
| 222| 222| 
| 223| 223| 	// create units
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetClassesList' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 228| 228| 		var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
| 229| 229| 
| 230| 230| 		AddMock(unit + i, IID_Identity, {
| 231|    |-			GetClassesList: function() { return []; },
|    | 231|+			"GetClassesList": function() { return []; },
| 232| 232| 		});
| 233| 233| 
| 234| 234| 		AddMock(unit + i, IID_Ownership, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetOwner' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 232| 232| 		});
| 233| 233| 
| 234| 234| 		AddMock(unit + i, IID_Ownership, {
| 235|    |-			GetOwner: function() { return 1; },
|    | 235|+			"GetOwner": function() { return 1; },
| 236| 236| 		});
| 237| 237| 
| 238| 238| 		AddMock(unit + i, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 236| 236| 		});
| 237| 237| 
| 238| 238| 		AddMock(unit + i, IID_Position, {
| 239|    |-			GetTurretParent: function() { return INVALID_ENTITY; },
|    | 239|+			"GetTurretParent": function() { return INVALID_ENTITY; },
| 240| 240| 			GetPosition: function() { return new Vector3D(); },
| 241| 241| 			GetPosition2D: function() { return new Vector2D(); },
| 242| 242| 			GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 237| 237| 
| 238| 238| 		AddMock(unit + i, IID_Position, {
| 239| 239| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 240|    |-			GetPosition: function() { return new Vector3D(); },
|    | 240|+			"GetPosition": function() { return new Vector3D(); },
| 241| 241| 			GetPosition2D: function() { return new Vector2D(); },
| 242| 242| 			GetRotation: function() { return { "y": 0 }; },
| 243| 243| 			IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 238| 238| 		AddMock(unit + i, IID_Position, {
| 239| 239| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 240| 240| 			GetPosition: function() { return new Vector3D(); },
| 241|    |-			GetPosition2D: function() { return new Vector2D(); },
|    | 241|+			"GetPosition2D": function() { return new Vector2D(); },
| 242| 242| 			GetRotation: function() { return { "y": 0 }; },
| 243| 243| 			IsInWorld: function() { return true; },
| 244| 244| 		});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 239| 239| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 240| 240| 			GetPosition: function() { return new Vector3D(); },
| 241| 241| 			GetPosition2D: function() { return new Vector2D(); },
| 242|    |-			GetRotation: function() { return { "y": 0 }; },
|    | 242|+			"GetRotation": function() { return { "y": 0 }; },
| 243| 243| 			IsInWorld: function() { return true; },
| 244| 244| 		});
| 245| 245| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 240| 240| 			GetPosition: function() { return new Vector3D(); },
| 241| 241| 			GetPosition2D: function() { return new Vector2D(); },
| 242| 242| 			GetRotation: function() { return { "y": 0 }; },
| 243|    |-			IsInWorld: function() { return true; },
|    | 243|+			"IsInWorld": function() { return true; },
| 244| 244| 		});
| 245| 245| 
| 246| 246| 		AddMock(unit + i, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 252| 252| 		});
| 253| 253| 
| 254| 254| 		AddMock(unit + i, IID_Vision, {
| 255|    |-			GetRange: function() { return 10; },
|    | 255|+			"GetRange": function() { return 10; },
| 256| 256| 		});
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 256| 256| 		});
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 259|+			"GetRange": function() { return {"max":10, "min": 0}; },
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "Melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 256| 256| 		});
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 259|+			GetRange: function() { return { "max":10, "min": 0}; },
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "Melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'max'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 256| 256| 		});
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 259|+			GetRange: function() { return {"max": 10, "min": 0}; },
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "Melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 256| 256| 		});
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 259|+			GetRange: function() { return {"max":10, "min": 0 }; },
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "Melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetFullAttackRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259| 259| 			GetRange: function() { return {"max":10, "min": 0}; },
| 260|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 260|+			"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "Melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 263| 263| 			CanAttack: function(v) { return true; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259| 259| 			GetRange: function() { return {"max":10, "min": 0}; },
| 260|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 260|+			GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "Melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 263| 263| 			CanAttack: function(v) { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetBestAttackAgainst' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259| 259| 			GetRange: function() { return {"max":10, "min": 0}; },
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261|    |-			GetBestAttackAgainst: function(t) { return "Melee"; },
|    | 261|+			"GetBestAttackAgainst": function(t) { return "Melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 263| 263| 			CanAttack: function(v) { return true; },
| 264| 264| 			CompareEntitiesByPreference: function(a, b) { return 0; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTimers' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 259| 259| 			GetRange: function() { return {"max":10, "min": 0}; },
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "Melee"; },
| 262|    |-			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 262|+			"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 263| 263| 			CanAttack: function(v) { return true; },
| 264| 264| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 265| 265| 		});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CanAttack' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "Melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 263|    |-			CanAttack: function(v) { return true; },
|    | 263|+			"CanAttack": function(v) { return true; },
| 264| 264| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 265| 265| 		});
| 266| 266| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CompareEntitiesByPreference' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 261| 261| 			GetBestAttackAgainst: function(t) { return "Melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 263| 263| 			CanAttack: function(v) { return true; },
| 264|    |-			CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 264|+			"CompareEntitiesByPreference": function(a, b) { return 0; },
| 265| 265| 		});
| 266| 266| 
| 267| 267| 		unitAI.OnCreate();
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetHitpoints' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 273| 273| 
| 274| 274| 	// create enemy
| 275| 275| 	AddMock(enemy, IID_Health, {
| 276|    |-		GetHitpoints: function() { return 40; },
|    | 276|+		"GetHitpoints": function() { return 40; },
| 277| 277| 	});
| 278| 278| 
| 279| 279| 	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 276| 276| 		GetHitpoints: function() { return 40; },
| 277| 277| 	});
| 278| 278| 
| 279|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 279|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 280| 280| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 281| 281| 
| 282| 282| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 276| 276| 		GetHitpoints: function() { return 40; },
| 277| 277| 	});
| 278| 278| 
| 279|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 279|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 280| 280| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 281| 281| 
| 282| 282| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 280| 280| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 281| 281| 
| 282| 282| 	AddMock(controller, IID_Position, {
| 283|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 283|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 284| 284| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 285| 285| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 286| 286| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'JumpTo' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 281| 281| 
| 282| 282| 	AddMock(controller, IID_Position, {
| 283| 283| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 284|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 284|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 285| 285| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 286| 286| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 287| 287| 		GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 282| 282| 	AddMock(controller, IID_Position, {
| 283| 283| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 284| 284| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 285|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 285|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 286| 286| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 287| 287| 		GetRotation: function() { return { "y": 0 }; },
| 288| 288| 		IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 283| 283| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 284| 284| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 285| 285| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 286|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 286|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 287| 287| 		GetRotation: function() { return { "y": 0 }; },
| 288| 288| 		IsInWorld: function() { return true; },
| 289| 289| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 284| 284| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 285| 285| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 286| 286| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 287|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 287|+		"GetRotation": function() { return { "y": 0 }; },
| 288| 288| 		IsInWorld: function() { return true; },
| 289| 289| 	});
| 290| 290| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 285| 285| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 286| 286| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 287| 287| 		GetRotation: function() { return { "y": 0 }; },
| 288|    |-		IsInWorld: function() { return true; },
|    | 288|+		"IsInWorld": function() { return true; },
| 289| 289| 	});
| 290| 290| 
| 291| 291| 	AddMock(controller, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 297| 297| 	});
| 298| 298| 
| 299| 299| 	AddMock(controller, IID_Attack, {
| 300|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 300|+		"GetRange": function() { return {"max":10, "min": 0}; },
| 301| 301| 		CanAttackAsFormation: function() { return false; },
| 302| 302| 	});
| 303| 303| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 297| 297| 	});
| 298| 298| 
| 299| 299| 	AddMock(controller, IID_Attack, {
| 300|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 300|+		GetRange: function() { return { "max":10, "min": 0}; },
| 301| 301| 		CanAttackAsFormation: function() { return false; },
| 302| 302| 	});
| 303| 303| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'max'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 297| 297| 	});
| 298| 298| 
| 299| 299| 	AddMock(controller, IID_Attack, {
| 300|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 300|+		GetRange: function() { return {"max": 10, "min": 0}; },
| 301| 301| 		CanAttackAsFormation: function() { return false; },
| 302| 302| 	});
| 303| 303| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 297| 297| 	});
| 298| 298| 
| 299| 299| 	AddMock(controller, IID_Attack, {
| 300|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 300|+		GetRange: function() { return {"max":10, "min": 0 }; },
| 301| 301| 		CanAttackAsFormation: function() { return false; },
| 302| 302| 	});
| 303| 303| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CanAttackAsFormation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 298| 298| 
| 299| 299| 	AddMock(controller, IID_Attack, {
| 300| 300| 		GetRange: function() { return {"max":10, "min": 0}; },
| 301|    |-		CanAttackAsFormation: function() { return false; },
|    | 301|+		"CanAttackAsFormation": function() { return false; },
| 302| 302| 	});
| 303| 303| 
| 304| 304| 	controllerAI.OnCreate();
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 310| 310| 	for (var ent of unitAIs)
| 311| 311| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 312| 312| 
| 313|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 313|+	controllerAI.MoveIntoFormation({ "name": "Circle"});
| 314| 314| 
| 315| 315| 	// let all units be in position
| 316| 316| 	for (var ent of unitAIs)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 310| 310| 	for (var ent of unitAIs)
| 311| 311| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 312| 312| 
| 313|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 313|+	controllerAI.MoveIntoFormation({"name": "Circle" });
| 314| 314| 
| 315| 315| 	// let all units be in position
| 316| 316| 	for (var ent of unitAIs)

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  47| »   »   ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·},
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Closing curly brace appears on the same line as the subsequent block.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 224| »   for·(var·i·=·0;·i·<·unitCount;·i++)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 316| »   for·(var·ent·of·unitAIs)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 319| »   for·(var·ent·of·unitAIs)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 311| »   »   TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING");
|    | [NORMAL] JSHintBear:
|    | 'unitAI' used out of scope.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 320| »   »   TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING");
|    | [NORMAL] JSHintBear:
|    | 'unitAI' used out of scope.
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/DamageTypes.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/DamageTypes.js
|   6|   6| 		"Hack": { "name": markForTranslationWithContext("damage type", "Hack"), "receiveComponent": "health" },
|   7|   7| 		"Pierce": { "name": markForTranslationWithContext("damage type", "Pierce"), "receiveComponent": "health" },
|   8|   8| 		"Crush": { "name": markForTranslationWithContext("damage type", "Crush"), "receiveComponent": "health" },
|   9|    |-		"Capture": { "name": markForTranslationWithContext("damage type", "Capture"),"receiveComponent": "capturable" }
|    |   9|+		"Capture": { "name": markForTranslationWithContext("damage type", "Capture"), "receiveComponent": "capturable" }
|  10|  10| 	};
|  11|  11| 
|  12|  12| 	this.names = {};
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/DamageTypes.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/DamageTypes.js
|  14|  14| 		this.names[type] = this.types[type].name;
|  15|  15| 
|  16|  16| 	deepfreeze(this.types);
|  17|    |-	deepfreeze(this.names)
|    |  17|+	deepfreeze(this.names);
|  18|  18| }
|  19|  19| 
|  20|  20| DamageTypes.prototype.GetNames = function()

binaries/data/mods/public/globalscripts/DamageTypes.js
|  17| »   deepfreeze(this.names)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353| 353| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354| 354| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355|    |-		{
|    | 355|+		
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 358| 358| 				needToMove = false;
| 359|    |-		}
|    | 359|+		
| 360| 360| 
| 361| 361| 		if (needToMove)
| 362| 362| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 350| 350| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 351| 351| 		var needToMove = true;
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 353|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 354|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355| 355| 		{
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 517| 517| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 518| 518| 				}
| 519| 519| 				else
| 520|    |-				{
|    | 520|+				
| 521| 521| 					// We couldn't move there, or the target moved away
| 522| 522| 					this.FinishOrder();
| 523|    |-				}
|    | 523|+				
| 524| 524| 				return;
| 525| 525| 			}
| 526| 526| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 736| 736| 			}
| 737| 737| 			// Check if we are already in range, otherwise walk there
| 738| 738| 			if (!this.CheckGarrisonRange(msg.data.target))
| 739|    |-			{
|    | 739|+			
| 740| 740| 				if (!this.CheckTargetVisible(msg.data.target))
| 741| 741| 				{
| 742| 742| 					this.FinishOrder();
| 747| 747| 					this.SetNextState("GARRISON.APPROACHING");
| 748| 748| 					return;
| 749| 749| 				}
| 750|    |-			}
|    | 750|+			
| 751| 751| 
| 752| 752| 			this.SetNextState("GARRISON.GARRISONING");
| 753| 753| 		},
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 742| 742| 					this.FinishOrder();
| 743| 743| 					return;
| 744| 744| 				}
| 745|    |-				else
| 746|    |-				{
|    | 745|+				
| 747| 746| 					this.SetNextState("GARRISON.APPROACHING");
| 748| 747| 					return;
| 749|    |-				}
|    | 748|+				
| 750| 749| 			}
| 751| 750| 
| 752| 751| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 765| 765| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 766| 766| 					}
| 767| 767| 					else
| 768|    |-					{
|    | 768|+					
| 769| 769| 						// We couldn't move there, or the target moved away
| 770| 770| 						this.FinishOrder();
| 771|    |-					}
|    | 771|+					
| 772| 772| 					return;
| 773| 773| 				}
| 774| 774| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 998| 998| 			},
| 999| 999| 		},
|1000|1000| 
|1001|    |-		"GARRISON":{
|    |1001|+		"GARRISON": {
|1002|1002| 			"enter": function() {
|1003|1003| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1004|1004| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1209|1209| 			// If the controller handled an order but some members rejected it,
|1210|1210| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1211|1211| 			if (this.orderQueue.length)
|1212|    |-			{
|    |1212|+			
|1213|1213| 				// We're leaving the formation, so stop our FormationWalk order
|1214|1214| 				if (this.FinishOrder())
|1215|1215| 					return;
|1216|    |-			}
|    |1216|+			
|1217|1217| 
|1218|1218| 			// No orders left, we're an individual now
|1219|1219| 			this.SetNextState("INDIVIDUAL.IDLE");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1234|1234| 			// Move a tile outside the building
|1235|1235| 			let range = 4;
|1236|1236| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, -1))
|1237|    |-			{
|    |1237|+			
|1238|1238| 				// We are already at the target, or can't move at all
|1239|1239| 				this.FinishOrder();
|1240|    |-			}
|    |1240|+			
|1241|1241| 			else
|1242|1242| 			{
|1243|1243| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1435|1435| 
|1436|1436| 			"LosRangeUpdate": function(msg) {
|1437|1437| 				if (this.GetStance().targetVisibleEnemies)
|1438|    |-				{
|    |1438|+				
|1439|1439| 					// Start attacking one of the newly-seen enemy (if any)
|1440|1440| 					this.AttackEntitiesByPreference(msg.data.added);
|1441|    |-				}
|    |1441|+				
|1442|1442| 			},
|1443|1443| 
|1444|1444| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1483|1483| 				}
|1484|1484| 			},
|1485|1485| 
|1486|    |-			"leave": function () {
|    |1486|+			"leave": function() {
|1487|1487| 				this.StopMoving();
|1488|1488| 			},
|1489|1489| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1658|1658| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1659|1659| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1660|1660| 						if (cmpHealth && cmpHealth.IsInjured())
|1661|    |-						{
|    |1661|+						
|1662|1662| 							if (this.CanHeal(this.isGuardOf))
|1663|1663| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1664|1664| 							else if (this.CanRepair(this.isGuardOf))
|1665|1665| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1666|    |-						}
|    |1666|+						
|1667|1667| 					}
|1668|1668| 				},
|1669|1669| 
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1941|1941| 				"Attacked": function(msg) {
|1942|1942| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1943|1943| 					// TODO find out why we want this
|1944|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1945|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, ["Capture"]) != "Capture")
|    |1944|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1945|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, ["Capture"]) != "Capture")
|1946|1946| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1947|1947| 				},
|1948|1948| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1993|1993| 
|1994|1994| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|1995|1995| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|1996|    |-					{
|    |1996|+					
|1997|1997| 						// Run after a fleeing target
|1998|1998| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|1999|    |-					}
|    |1999|+					
|2000|2000| 					this.StartTimer(1000, 1000);
|2001|2001| 				},
|2002|2002| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2344|2344| 
|2345|2345| 				"Timer": function(msg) {
|2346|2346| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2347|    |-					{
|    |2347|+					
|2348|2348| 						// Return to our original position unless we have a better order.
|2349|2349| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2350|2350| 							this.WalkToHeldPosition();
|2351|    |-					}
|    |2351|+					
|2352|2352| 				},
|2353|2353| 
|2354|2354| 				"MovementUpdate": function() {
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2378|2378| 					this.StartTimer(prepare, this.healTimers.repeat);
|2379|2379| 
|2380|2380| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2381|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2381|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2382|2382| 
|2383|2383| 					this.FaceTowardsTarget(this.order.data.target);
|2384|2384| 				},
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2586|2586| 					{
|2587|2587| 						// The building was already finished/fully repaired before we arrived;
|2588|2588| 						// let the ConstructionFinished handler handle this.
|2589|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2589|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2590|2590| 						return true;
|2591|2591| 					}
|2592|2592| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2586|2586| 					{
|2587|2587| 						// The building was already finished/fully repaired before we arrived;
|2588|2588| 						// let the ConstructionFinished handler handle this.
|2589|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2589|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2590|2590| 						return true;
|2591|2591| 					}
|2592|2592| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2971|2971| 		"Attacked": function(msg) {
|2972|2972| 			if (this.template.NaturalBehaviour == "skittish" ||
|2973|2973| 			    this.template.NaturalBehaviour == "passive")
|2974|    |-			{
|    |2974|+			
|2975|2975| 				this.Flee(msg.data.attacker, false);
|2976|    |-			}
|    |2976|+			
|2977|2977| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2978|2978| 			{
|2979|2979| 				if (this.CanAttack(msg.data.attacker))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2980|2980| 					this.Attack(msg.data.attacker, false);
|2981|2981| 			}
|2982|2982| 			else if (this.template.NaturalBehaviour == "domestic")
|2983|    |-			{
|    |2983|+			
|2984|2984| 				// Never flee, stop what we were doing
|2985|2985| 				this.SetNextState("IDLE");
|2986|    |-			}
|    |2986|+			
|2987|2987| 		},
|2988|2988| 
|2989|2989| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3034|3034| 				}
|3035|3035| 				// Start attacking one of the newly-seen enemy (if any)
|3036|3036| 				else if (this.IsDangerousAnimal())
|3037|    |-				{
|    |3037|+				
|3038|3038| 					this.AttackVisibleEntity(msg.data.added);
|3039|    |-				}
|    |3039|+				
|3040|3040| 
|3041|3041| 				// TODO: if two units enter our range together, we'll attack the
|3042|3042| 				// first and then the second won't trigger another LosRangeUpdate
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3078|3078| 				}
|3079|3079| 				// Start attacking one of the newly-seen enemy (if any)
|3080|3080| 				else if (this.template.NaturalBehaviour == "violent")
|3081|    |-				{
|    |3081|+				
|3082|3082| 					this.AttackVisibleEntity(msg.data.added);
|3083|    |-				}
|    |3083|+				
|3084|3084| 			},
|3085|3085| 
|3086|3086| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3093|3093| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3094|3094| 
|3095|3095| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3096|    |-							// only used for domestic animals
|    |3096|+		// only used for domestic animals
|3097|3097| 	},
|3098|3098| };
|3099|3099| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3150|3150| 
|3151|3151| UnitAI.prototype.IsAnimal = function()
|3152|3152| {
|3153|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3153|+	return (!!this.template.NaturalBehaviour);
|3154|3154| };
|3155|3155| 
|3156|3156| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3188|3188| UnitAI.prototype.GetGarrisonHolder = function()
|3189|3189| {
|3190|3190| 	if (this.IsGarrisoned())
|3191|    |-	{
|    |3191|+	
|3192|3192| 		for (let order of this.orderQueue)
|3193|3193| 			if (order.type == "Garrison")
|3194|3194| 				return order.data.target;
|3195|    |-	}
|    |3195|+	
|3196|3196| 	return INVALID_ENTITY;
|3197|3197| };
|3198|3198| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3266|3266| 		{
|3267|3267| 			let index = this.GetCurrentState().indexOf(".");
|3268|3268| 			if (index != -1)
|3269|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3269|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3270|3270| 			this.Stop(false);
|3271|3271| 		}
|3272|3272| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3322|3322| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3323|3323| 			continue;
|3324|3324| 		if (i == 0)
|3325|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3325|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3326|3326| 		else
|3327|3327| 			this.orderQueue.splice(i, 1);
|3328|3328| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3322|3322| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3323|3323| 			continue;
|3324|3324| 		if (i == 0)
|3325|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3325|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3326|3326| 		else
|3327|3327| 			this.orderQueue.splice(i, 1);
|3328|3328| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3406|3406| };
|3407|3407| 
|3408|3408| 
|3409|    |-//// FSM linkage functions ////
|    |3409|+// // FSM linkage functions ////
|3410|3410| 
|3411|3411| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3412|3412| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3576|3576| 				continue;
|3577|3577| 			if (this.orderQueue[i].type == type)
|3578|3578| 				continue;
|3579|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3579|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3580|3580| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3581|3581| 			return;
|3582|3582| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3576|3576| 				continue;
|3577|3577| 			if (this.orderQueue[i].type == type)
|3578|3578| 				continue;
|3579|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3579|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3580|3580| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3581|3581| 			return;
|3582|3582| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3590|3590| {
|3591|3591| 	// Remember the previous work orders to be able to go back to them later if required
|3592|3592| 	if (data && data.force)
|3593|    |-	{
|    |3593|+	
|3594|3594| 		if (this.IsFormationController())
|3595|3595| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3596|3596| 		else
|3597|3597| 			this.UpdateWorkOrders(type);
|3598|    |-	}
|    |3598|+	
|3599|3599| 
|3600|3600| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3601|3601| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3667|3667| 	{
|3668|3668| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3669|3669| 		if (cmpUnitAI)
|3670|    |-		{
|    |3670|+		
|3671|3671| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3672|3672| 			{
|3673|3673| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3676|3676| 					return;
|3677|3677| 				}
|3678|3678| 			}
|3679|    |-		}
|    |3679|+		
|3680|3680| 	}
|3681|3681| 
|3682|3682| 	// If nothing found, take the unit orders
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3669|3669| 		if (cmpUnitAI)
|3670|3670| 		{
|3671|3671| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3672|    |-			{
|    |3672|+			
|3673|3673| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3674|3674| 				{
|3675|3675| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3676|3676| 					return;
|3677|3677| 				}
|3678|    |-			}
|    |3678|+			
|3679|3679| 		}
|3680|3680| 	}
|3681|3681| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3681|3681| 
|3682|3682| 	// If nothing found, take the unit orders
|3683|3683| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3684|    |-	{
|    |3684|+	
|3685|3685| 		if (isWorkType(this.orderQueue[i].type))
|3686|3686| 		{
|3687|3687| 			this.workOrders = this.orderQueue.slice(i);
|3688|3688| 			return;
|3689|3689| 		}
|3690|    |-	}
|    |3690|+	
|3691|3691| };
|3692|3692| 
|3693|3693| UnitAI.prototype.BackToWork = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3747|3747| 	if (data.timerRepeat === undefined)
|3748|3748| 		this.timer = undefined;
|3749|3749| 
|3750|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3750|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3751|3751| };
|3752|3752| 
|3753|3753| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3747|3747| 	if (data.timerRepeat === undefined)
|3748|3748| 		this.timer = undefined;
|3749|3749| 
|3750|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3750|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3751|3751| };
|3752|3752| 
|3753|3753| /**
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3782|3782| 	this.timer = undefined;
|3783|3783| };
|3784|3784| 
|3785|    |-//// Message handlers /////
|    |3785|+// // Message handlers /////
|3786|3786| 
|3787|3787| UnitAI.prototype.OnMotionChanged = function(msg)
|3788|3788| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3794|3794| 	// TODO: This is a bit inefficient since every unit listens to every
|3795|3795| 	// construction message - ideally we could scope it to only the one we're building
|3796|3796| 
|3797|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3797|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3798|3798| };
|3799|3799| 
|3800|3800| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3794|3794| 	// TODO: This is a bit inefficient since every unit listens to every
|3795|3795| 	// construction message - ideally we could scope it to only the one we're building
|3796|3796| 
|3797|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3797|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3798|3798| };
|3799|3799| 
|3800|3800| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3819|3819| 
|3820|3820| UnitAI.prototype.OnAttacked = function(msg)
|3821|3821| {
|3822|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3822|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3823|3823| };
|3824|3824| 
|3825|3825| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3819|3819| 
|3820|3820| UnitAI.prototype.OnAttacked = function(msg)
|3821|3821| {
|3822|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3822|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3823|3823| };
|3824|3824| 
|3825|3825| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3824|3824| 
|3825|3825| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3826|3826| {
|3827|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3827|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3828|3828| };
|3829|3829| 
|3830|3830| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3824|3824| 
|3825|3825| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3826|3826| {
|3827|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3827|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3828|3828| };
|3829|3829| 
|3830|3830| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3829|3829| 
|3830|3830| UnitAI.prototype.OnHealthChanged = function(msg)
|3831|3831| {
|3832|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3832|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3833|3833| };
|3834|3834| 
|3835|3835| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3829|3829| 
|3830|3830| UnitAI.prototype.OnHealthChanged = function(msg)
|3831|3831| {
|3832|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3832|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3833|3833| };
|3834|3834| 
|3835|3835| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3835|3835| UnitAI.prototype.OnRangeUpdate = function(msg)
|3836|3836| {
|3837|3837| 	if (msg.tag == this.losRangeQuery)
|3838|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3838|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3839|3839| 	else if (msg.tag == this.losHealRangeQuery)
|3840|3840| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3841|3841| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3835|3835| UnitAI.prototype.OnRangeUpdate = function(msg)
|3836|3836| {
|3837|3837| 	if (msg.tag == this.losRangeQuery)
|3838|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3838|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3839|3839| 	else if (msg.tag == this.losHealRangeQuery)
|3840|3840| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3841|3841| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3837|3837| 	if (msg.tag == this.losRangeQuery)
|3838|3838| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3839|3839| 	else if (msg.tag == this.losHealRangeQuery)
|3840|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3840|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3841|3841| };
|3842|3842| 
|3843|3843| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3837|3837| 	if (msg.tag == this.losRangeQuery)
|3838|3838| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3839|3839| 	else if (msg.tag == this.losHealRangeQuery)
|3840|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3840|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3841|3841| };
|3842|3842| 
|3843|3843| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3842|3842| 
|3843|3843| UnitAI.prototype.OnPackFinished = function(msg)
|3844|3844| {
|3845|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3845|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3846|3846| };
|3847|3847| 
|3848|3848| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3842|3842| 
|3843|3843| UnitAI.prototype.OnPackFinished = function(msg)
|3844|3844| {
|3845|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3845|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3846|3846| };
|3847|3847| 
|3848|3848| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3845|3845| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3846|3846| };
|3847|3847| 
|3848|    |-//// Helper functions to be called by the FSM ////
|    |3848|+// // Helper functions to be called by the FSM ////
|3849|3849| 
|3850|3850| UnitAI.prototype.GetWalkSpeed = function()
|3851|3851| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4032|4032| 			PlaySound(name, member);
|4033|4033| 	}
|4034|4034| 	else
|4035|    |-	{
|    |4035|+	
|4036|4036| 		// Otherwise use our own sounds
|4037|4037| 		PlaySound(name, this.entity);
|4038|    |-	}
|    |4038|+	
|4039|4039| };
|4040|4040| 
|4041|4041| /*
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4478|4478| UnitAI.prototype.AttackEntityInZone = function(ents)
|4479|4479| {
|4480|4480| 	var target = ents.find(target =>
|4481|    |-		this.CanAttack(target)
|4482|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, ["Capture"]))
|    |4481|+		this.CanAttack(target) &&
|    |4482|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, ["Capture"]))
|4483|4483| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4484|4484| 	);
|4485|4485| 	if (!target)
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4479|4479| {
|4480|4480| 	var target = ents.find(target =>
|4481|4481| 		this.CanAttack(target)
|4482|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, ["Capture"]))
|4483|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4482|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, ["Capture"])) &&
|    |4483|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4484|4484| 	);
|4485|4485| 	if (!target)
|4486|4486| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4543|4543| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4544|4544| 	if (this.isGuardOf)
|4545|4545| 	{
|4546|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4546|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4547|4547| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4548|4548| 		if (cmpUnitAI && cmpAttack &&
|4549|4549| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4547|4547| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4548|4548| 		if (cmpUnitAI && cmpAttack &&
|4549|4549| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4550|    |-				return false;
|    |4550|+			return false;
|4551|4551| 	}
|4552|4552| 
|4553|4553| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4552|4552| 
|4553|4553| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4554|4554| 	if (this.GetStance().respondHoldGround)
|4555|    |-	{
|    |4555|+	
|4556|4556| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4557|4557| 			return true;
|4558|    |-	}
|    |4558|+	
|4559|4559| 
|4560|4560| 	// Stop if it's left our vision range, unless we're especially persistent
|4561|4561| 	if (!this.GetStance().respondChaseBeyondVision)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4559|4559| 
|4560|4560| 	// Stop if it's left our vision range, unless we're especially persistent
|4561|4561| 	if (!this.GetStance().respondChaseBeyondVision)
|4562|    |-	{
|    |4562|+	
|4563|4563| 		if (!this.CheckTargetIsInVisionRange(target))
|4564|4564| 			return true;
|4565|    |-	}
|    |4565|+	
|4566|4566| 
|4567|4567| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4568|4568| 	// and will continue moving to its last seen position and then stop)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4585|4585| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4586|4586| 	if (this.isGuardOf)
|4587|4587| 	{
|4588|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4588|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4589|4589| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4590|4590| 		if (cmpUnitAI && cmpAttack &&
|4591|4591| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4598|4598| 	return false;
|4599|4599| };
|4600|4600| 
|4601|    |-//// External interface functions ////
|    |4601|+// // External interface functions ////
|4602|4602| 
|4603|4603| UnitAI.prototype.SetFormationController = function(ent)
|4604|4604| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4608|4608| 	// of our own formation (or ourself if not in formation)
|4609|4609| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4610|4610| 	if (cmpObstruction)
|4611|    |-	{
|    |4611|+	
|4612|4612| 		if (ent == INVALID_ENTITY)
|4613|4613| 			cmpObstruction.SetControlGroup(this.entity);
|4614|4614| 		else
|4615|4615| 			cmpObstruction.SetControlGroup(ent);
|4616|    |-	}
|    |4616|+	
|4617|4617| 
|4618|4618| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4619|4619| 	if (ent == INVALID_ENTITY)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4751|4751| 	// if we already had an old guard order, do nothing if the target is the same
|4752|4752| 	// and the order is running, otherwise remove the previous order
|4753|4753| 	if (this.isGuardOf)
|4754|    |-	{
|    |4754|+	
|4755|4755| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4756|4756| 			return;
|4757|4757| 		else
|4758|4758| 			this.RemoveGuard();
|4759|    |-	}
|    |4759|+	
|4760|4760| 
|4761|4761| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4762|4762| };
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4754|4754| 	{
|4755|4755| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4756|4756| 			return;
|4757|    |-		else
|4758|    |-			this.RemoveGuard();
|    |4757|+		this.RemoveGuard();
|4759|4758| 	}
|4760|4759| 
|4761|4760| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5086|5086| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5087|5087| 	{
|5088|5088| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5089|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5089|+		if (cmpTrader.HasBothMarkets() &&
|5090|5090| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5091|5091| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5092|5092| 		{
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5367|5367| 				{
|5368|5368| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5369|5369| 					var targetClasses = this.order.data.targetClasses;
|5370|    |-					if (targetClasses.attack && cmpIdentity
|5371|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5370|+					if (targetClasses.attack && cmpIdentity &&
|    |5371|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5372|5372| 						continue;
|5373|5373| 					if (targetClasses.avoid && cmpIdentity
|5374|5374| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5370|5370| 					if (targetClasses.attack && cmpIdentity
|5371|5371| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5372|5372| 						continue;
|5373|    |-					if (targetClasses.avoid && cmpIdentity
|5374|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5373|+					if (targetClasses.avoid && cmpIdentity &&
|    |5374|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5375|5375| 						continue;
|5376|5376| 					// Only used by the AIs to prevent some choices of targets
|5377|5377| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5393|5393| 		{
|5394|5394| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5395|5395| 			var targetClasses = this.order.data.targetClasses;
|5396|    |-			if (cmpIdentity && targetClasses.attack
|5397|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5396|+			if (cmpIdentity && targetClasses.attack &&
|    |5397|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5398|5398| 				continue;
|5399|5399| 			if (cmpIdentity && targetClasses.avoid
|5400|5400| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5396|5396| 			if (cmpIdentity && targetClasses.attack
|5397|5397| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5398|5398| 				continue;
|5399|    |-			if (cmpIdentity && targetClasses.avoid
|5400|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5399|+			if (cmpIdentity && targetClasses.avoid &&
|    |5400|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5401|5401| 				continue;
|5402|5402| 			// Only used by the AIs to prevent some choices of targets
|5403|5403| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5553|5553| 
|5554|5554| UnitAI.prototype.SetHeldPosition = function(x, z)
|5555|5555| {
|5556|    |-	this.heldPosition = {"x": x, "z": z};
|    |5556|+	this.heldPosition = { "x": x, "z": z};
|5557|5557| };
|5558|5558| 
|5559|5559| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5553|5553| 
|5554|5554| UnitAI.prototype.SetHeldPosition = function(x, z)
|5555|5555| {
|5556|    |-	this.heldPosition = {"x": x, "z": z};
|    |5556|+	this.heldPosition = {"x": x, "z": z };
|5557|5557| };
|5558|5558| 
|5559|5559| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5580|5580| 	return false;
|5581|5581| };
|5582|5582| 
|5583|    |-//// Helper functions ////
|    |5583|+// // Helper functions ////
|5584|5584| 
|5585|5585| UnitAI.prototype.CanAttack = function(target)
|5586|5586| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5784|5784| 	return cmpPack && cmpPack.IsPacking();
|5785|5785| };
|5786|5786| 
|5787|    |-//// Formation specific functions ////
|    |5787|+// // Formation specific functions ////
|5788|5788| 
|5789|5789| UnitAI.prototype.IsAttackingAsFormation = function()
|5790|5790| {
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5789|5789| UnitAI.prototype.IsAttackingAsFormation = function()
|5790|5790| {
|5791|5791| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5792|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5793|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5792|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5793|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5794|5794| };
|5795|5795| 
|5796|5796| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5793|5793| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5794|5794| };
|5795|5795| 
|5796|    |-//// Animal specific functions ////
|    |5796|+// // Animal specific functions ////
|5797|5797| 
|5798|5798| UnitAI.prototype.MoveRandomly = function(distance)
|5799|5799| {

binaries/data/mods/public/simulation/components/UnitAI.js
| 327| »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'Order.WalkToTarget' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
| 891| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 913| »   »   »   "enter":·function(msg)·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 960| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1023| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1058| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1090| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1248| »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1307| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1398| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1478| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1497| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1526| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1678| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1728| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1803| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1968| »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1973| »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1979| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1984| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2072| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2324| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2442| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2504| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2543| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2749| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2929| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3652| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4465| »   var·target·=·ents.find(target·=>·this.CanAttack(target));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4480| »   var·target·=·ents.find(target·=>
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4526| »   var·ent·=·ents.find(ent·=>·this.CanHeal(ent));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4549| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
| 354| »   »   ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|1945| »   »   »   »   »   »   &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·["Capture"])·!=·"Capture")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2481| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3614| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3683| »   for·(var·i·=·0;·i·<·this.orderQueue.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|4482| »   »   &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·["Capture"]))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4483| »   »   &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5371| »   »   »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5374| »   »   »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5387| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5388| »   for·(var·targ·of·targets)
|    | [NORMAL] JSHintBear:
|    | 'targ' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5394| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity);
|    | [NORMAL] JSHintBear:
|    | 'cmpIdentity' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5395| »   »   »   var·targetClasses·=·this.order.data.targetClasses;
|    | [NORMAL] JSHintBear:
|    | 'targetClasses' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5397| »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5400| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5475| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5478| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5483| »   »   var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid);
|    | [NORMAL] JSHintBear:
|    | 'cmpRanged' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5486| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5487| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5497| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5500| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5793| »   »   &&·this.GetCurrentState()·==·"FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/maps/tutorials/Introductory_Tutorial.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/maps/tutorials/Introductory_Tutorial.js
| 381| 381| 	let position = Engine.QueryInterface(target, IID_Position).GetPosition2D();
| 382| 382| 
| 383| 383| 	this.attackers = cmpRangeManager.GetEntitiesByPlayer(this.enemyID).filter(e =>
| 384|    |-			Engine.QueryInterface(e, IID_Identity) && Engine.QueryInterface(e, IID_UnitAI) &&
|    | 384|+		Engine.QueryInterface(e, IID_Identity) && Engine.QueryInterface(e, IID_UnitAI) &&
| 385| 385| 			Engine.QueryInterface(e, IID_Identity).HasClass("CitizenSoldier")
| 386| 386| 		);
| 387| 387| 	this.attackers.forEach(e => { Engine.QueryInterface(e, IID_UnitAI).WalkAndFight(position.x, position.y, { "attack": ["Unit"] }, ["!Capture"]); });
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/maps/tutorials/Introductory_Tutorial.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/maps/tutorials/Introductory_Tutorial.js
| 383| 383| 	this.attackers = cmpRangeManager.GetEntitiesByPlayer(this.enemyID).filter(e =>
| 384| 384| 			Engine.QueryInterface(e, IID_Identity) && Engine.QueryInterface(e, IID_UnitAI) &&
| 385| 385| 			Engine.QueryInterface(e, IID_Identity).HasClass("CitizenSoldier")
| 386|    |-		);
|    | 386|+	);
| 387| 387| 	this.attackers.forEach(e => { Engine.QueryInterface(e, IID_UnitAI).WalkAndFight(position.x, position.y, { "attack": ["Unit"] }, ["!Capture"]); });
| 388| 388| };
| 389| 389| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Damage.js
|  23|  23| 	let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
|  24|  24| 	let turnLength = cmpTimer.GetLatestTurnLength();
|  25|  25| 	return new Vector3D(
|  26|    |-			(curPos.x * (turnLength - lateness) + prevPos.x * lateness) / turnLength,
|    |  26|+		(curPos.x * (turnLength - lateness) + prevPos.x * lateness) / turnLength,
|  27|  27| 			0,
|  28|  28| 			(curPos.z * (turnLength - lateness) + prevPos.z * lateness) / turnLength);
|  29|  29| };
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Damage.js
|  24|  24| 	let turnLength = cmpTimer.GetLatestTurnLength();
|  25|  25| 	return new Vector3D(
|  26|  26| 			(curPos.x * (turnLength - lateness) + prevPos.x * lateness) / turnLength,
|  27|    |-			0,
|    |  27|+		0,
|  28|  28| 			(curPos.z * (turnLength - lateness) + prevPos.z * lateness) / turnLength);
|  29|  29| };
|  30|  30| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Damage.js
|  25|  25| 	return new Vector3D(
|  26|  26| 			(curPos.x * (turnLength - lateness) + prevPos.x * lateness) / turnLength,
|  27|  27| 			0,
|  28|    |-			(curPos.z * (turnLength - lateness) + prevPos.z * lateness) / turnLength);
|    |  28|+		(curPos.z * (turnLength - lateness) + prevPos.z * lateness) / turnLength);
|  29|  29| };
|  30|  30| 
|  31|  31| /**
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Damage.js
| 112| 112| 
| 113| 113| 	// Do this first in case the direct hit kills the target
| 114| 114| 	if (data.isSplash)
| 115|    |-	{
|    | 115|+	
| 116| 116| 		this.CauseSplashDamage({
| 117| 117| 			"attacker": data.attacker,
| 118| 118| 			"origin": Vector2D.from3D(data.position),
| 125| 125| 			"type": data.type,
| 126| 126| 			"attackerOwner": data.attackerOwner
| 127| 127| 		});
| 128|    |-	}
|    | 128|+	
| 129| 129| 
| 130| 130| 	let cmpProjectileManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ProjectileManager);
| 131| 131| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Damage.js
| 218| 218| 				damageMultiplier = 0;
| 219| 219| 		}
| 220| 220| 		else // In case someone calls this function with an invalid shape.
| 221|    |-		{
|    | 221|+		
| 222| 222| 			warn("The " + data.shape + " splash damage shape is not implemented!");
| 223|    |-		}
|    | 223|+		
| 224| 224| 
| 225| 225| 		if (data.splashBonus)
| 226| 226| 			damageMultiplier *= GetDamageBonus(data.attacker, ent, data.type, data.splashBonus);
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Damage.js
| 284| 284| 	let cmpPromotion = Engine.QueryInterface(data.attacker, IID_Promotion);
| 285| 285| 	let cmpLoot = Engine.QueryInterface(data.target, IID_Loot);
| 286| 286| 	let cmpHealth = Engine.QueryInterface(data.target, IID_Health);
| 287|    |-	//TODO capture?
|    | 287|+	// TODO capture?
| 288| 288| 	if (cmpPromotion && cmpLoot && cmpLoot.GetXp() > 0)
| 289| 289| 		cmpPromotion.IncreaseXp(cmpLoot.GetXp() * -targetState.healthChange / cmpHealth.GetMaxHitpoints());
| 290| 290| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|   9|   9| Engine.LoadComponentScript("interfaces/Capturable.js");
|  10|  10| Engine.LoadComponentScript("interfaces/Damage.js");
|  11|  11| Engine.LoadComponentScript("interfaces/DamageReceiver.js");
|  12|    |-Engine.LoadComponentScript("interfaces/Formation.js")
|    |  12|+Engine.LoadComponentScript("interfaces/Formation.js");
|  13|  13| Engine.LoadComponentScript("interfaces/Health.js");
|  14|  14| Engine.LoadComponentScript("interfaces/Loot.js");
|  15|  15| Engine.LoadComponentScript("interfaces/Player.js");
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'turnLength' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|  27|  27| 
|  28|  28| 	let cmpDamage = ConstructComponent(SYSTEM_ENTITY, "Damage");
|  29|  29| 	let cmpTimer = ConstructComponent(SYSTEM_ENTITY, "Timer");
|  30|    |-	cmpTimer.OnUpdate({ turnLength: 1 });
|    |  30|+	cmpTimer.OnUpdate({ "turnLength": 1 });
|  31|  31| 	let attacker = 11;
|  32|  32| 	let atkPlayerEntity = 1;
|  33|  33| 	let attackerOwner = 6;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|  68|  68| 		"position": targetPos,
|  69|  69| 		"isSplash": false,
|  70|  70| 		"projectileId": 9,
|  71|    |-		"direction": new Vector3D(1,0,0)
|    |  71|+		"direction": new Vector3D(1, 0,0)
|  72|  72| 	};
|  73|  73| 
|  74|  74| 	AddMock(atkPlayerEntity, IID_Player, {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|  68|  68| 		"position": targetPos,
|  69|  69| 		"isSplash": false,
|  70|  70| 		"projectileId": 9,
|  71|    |-		"direction": new Vector3D(1,0,0)
|    |  71|+		"direction": new Vector3D(1,0, 0)
|  72|  72| 	};
|  73|  73| 
|  74|  74| 	AddMock(atkPlayerEntity, IID_Player, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'turnLength' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
| 129| 129| 
| 130| 130| 	function TestDamage()
| 131| 131| 	{
| 132|    |-		cmpTimer.OnUpdate({ turnLength: 1 });
|    | 132|+		cmpTimer.OnUpdate({ "turnLength": 1 });
| 133| 133| 		TS_ASSERT(damageTaken);
| 134| 134| 		damageTaken = false;
| 135| 135| 	}
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'hack'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
| 171| 171| 		"origin": origin,
| 172| 172| 		"radius": 10,
| 173| 173| 		"shape": "Linear",
| 174|    |-		"strengths": { "hack" : 100, "pierce" : 0, "crush": 0 },
|    | 174|+		"strengths": { "hack": 100, "pierce" : 0, "crush": 0 },
| 175| 175| 		"direction": new Vector3D(1, 747, 0),
| 176| 176| 		"playersToDamage": [2],
| 177| 177| 		"type": "Ranged",
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'pierce'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
| 171| 171| 		"origin": origin,
| 172| 172| 		"radius": 10,
| 173| 173| 		"shape": "Linear",
| 174|    |-		"strengths": { "hack" : 100, "pierce" : 0, "crush": 0 },
|    | 174|+		"strengths": { "hack" : 100, "pierce": 0, "crush": 0 },
| 175| 175| 		"direction": new Vector3D(1, 747, 0),
| 176| 176| 		"playersToDamage": [2],
| 177| 177| 		"type": "Ranged",
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
| 178| 178| 		"attackerOwner": attackerOwner
| 179| 179| 	};
| 180| 180| 
| 181|    |-	let fallOff = function(x,y)
|    | 181|+	let fallOff = function(x, y)
| 182| 182| 	{
| 183| 183| 		return (1 - x * x / (data.radius * data.radius)) * (1 - 25 * y * y / (data.radius * data.radius));
| 184| 184| 	};
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'hack'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
| 330| 330| 		"origin": new Vector2D(3, 4),
| 331| 331| 		"radius": radius,
| 332| 332| 		"shape": "Circular",
| 333|    |-		"strengths": { "hack" : 100, "pierce" : 0, "crush": 0 },
|    | 333|+		"strengths": { "hack": 100, "pierce" : 0, "crush": 0 },
| 334| 334| 		"playersToDamage": [2],
| 335| 335| 		"type": "Ranged",
| 336| 336| 		"attackerOwner": 1
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'pierce'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Damage.js
| 330| 330| 		"origin": new Vector2D(3, 4),
| 331| 331| 		"radius": radius,
| 332| 332| 		"shape": "Circular",
| 333|    |-		"strengths": { "hack" : 100, "pierce" : 0, "crush": 0 },
|    | 333|+		"strengths": { "hack" : 100, "pierce": 0, "crush": 0 },
| 334| 334| 		"playersToDamage": [2],
| 335| 335| 		"type": "Ranged",
| 336| 336| 		"attackerOwner": 1

binaries/data/mods/public/simulation/components/tests/test_Damage.js
| 140| »   type·=·data.type·=·"Ranged";
|    | [NORMAL] ESLintBear (no-multi-assign):
|    | Unexpected chained assignment.

binaries/data/mods/public/simulation/components/tests/test_Damage.js
|  12| Engine.LoadComponentScript("interfaces/Formation.js")
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|  18|  18| 	this.cp = [];
|  19|  19| };
|  20|  20| 
|  21|    |-//// Interface functions ////
|    |  21|+// // Interface functions ////
|  22|  22| 
|  23|  23| /**
|  24|  24|  * Returns the current capture points array
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|  33|  33| 	return this.maxCp;
|  34|  34| };
|  35|  35| 
|  36|    |-//TODO get rid of this
|    |  36|+// TODO get rid of this
|  37|  37| Capturable.prototype.GetMax = Capturable.prototype.GetMaxCapturePoints;
|  38|  38| 
|  39|  39| Capturable.prototype.GetGarrisonRegenRate = function()
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
| 144| 144| 	return sourceEnemyCp > 0;
| 145| 145| };
| 146| 146| 
| 147|    |-//// Private functions ////
|    | 147|+// // Private functions ////
| 148| 148| 
| 149| 149| /**
| 150| 150|  * This has to be called whenever the capture points are changed.
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
| 262| 262| 	Engine.PostMessage(this.entity, MT_CaptureRegenStateChanged, { "regenerating": true, "regenRate": regenRate, "territoryDecay": decay });
| 263| 263| };
| 264| 264| 
| 265|    |-//// Message Listeners ////
|    | 265|+// // Message Listeners ////
| 266| 266| 
| 267| 267| Capturable.prototype.OnValueModification = function(msg)
| 268| 268| {

binaries/data/mods/public/simulation/components/Capturable.js
| 194| »   »   var·garrisonRegenRate·=·0;
|    | [NORMAL] JSHintBear:
|    | 'garrisonRegenRate' is already defined.

binaries/data/mods/public/simulation/components/Capturable.js
| 196| »   return·regenRate·+·garrisonRegenRate;
|    | [NORMAL] JSHintBear:
|    | 'garrisonRegenRate' used out of scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 0.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseArmy.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseArmy.js
| 169| 169| 			plan.removeUnit(gameState, ent);
| 170| 170| 	}
| 171| 171| 
| 172|    |-/*
|    | 172|+	/*
| 173| 173| 	// TODO be sure that all units in the transport need the cancelation
| 174| 174| 	if (!ent.position())	// this unit must still be in a transport plan ... try to cancel it
| 175| 175| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseArmy.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseArmy.js
| 385| 385| {
| 386| 386| 	// copy over all parameters.
| 387| 387| 	for (let i in otherArmy.assignedAgainst)
| 388|    |-	{
|    | 388|+	
| 389| 389| 		if (this.assignedAgainst[i] === undefined)
| 390| 390| 			this.assignedAgainst[i] = otherArmy.assignedAgainst[i];
| 391| 391| 		else
| 392| 392| 			this.assignedAgainst[i] = this.assignedAgainst[i].concat(otherArmy.assignedAgainst[i]);
| 393|    |-	}
|    | 393|+	
| 394| 394| 	for (let i in otherArmy.assignedTo)
| 395| 395| 		this.assignedTo[i] = otherArmy.assignedTo[i];
| 396| 396| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseArmy.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseArmy.js
| 481| 481| 
| 482| 482| 	let entStrength;
| 483| 483| 	if (ent.hasClass("Structure"))
| 484|    |-	{
|    | 484|+	
| 485| 485| 		if (ent.owner() !== PlayerID)
| 486| 486| 			entStrength = ent.getDefaultArrow() ? 6*ent.getDefaultArrow() : 4;
| 487| 487| 		else	// small strength used only when we try to recover capture points
| 488| 488| 			entStrength = 2;
| 489|    |-	}
|    | 489|+	
| 490| 490| 	else
| 491| 491| 		entStrength = m.getMaxStrength(ent);
| 492| 492| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseArmy.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseArmy.js
| 510| 510| 	// otherwise it would remove the old entity from this army list
| 511| 511| 	// TODO we should may-be reevaluate the strength
| 512| 512| 	for (let evt of events.EntityRenamed)	// take care of promoted and packed units
| 513|    |-	{
|    | 513|+	
| 514| 514| 		if (this.foeEntities.indexOf(evt.entity) !== -1)
| 515| 515| 		{
| 516| 516| 			let ent = gameState.getEntityById(evt.newentity);
| 538| 538| 					this.assignedAgainst[against][this.assignedAgainst[against].indexOf(evt.entity)] = evt.newentity;
| 539| 539| 			}
| 540| 540| 		}
| 541|    |-	}
|    | 541|+	
| 542| 542| 
| 543| 543| 	for (let evt of events.Garrison)
| 544| 544| 		this.removeFoe(gameState, evt.entity);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseArmy.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseArmy.js
| 544| 544| 		this.removeFoe(gameState, evt.entity);
| 545| 545| 
| 546| 546| 	for (let evt of events.OwnershipChanged)	// captured
| 547|    |-	{
|    | 547|+	
| 548| 548| 		if (!gameState.isPlayerEnemy(evt.to))
| 549| 549| 			this.removeFoe(gameState, evt.entity);
| 550| 550| 		else if (evt.from === PlayerID)
| 551| 551| 			this.removeOwn(gameState, evt.entity);
| 552|    |-	}
|    | 552|+	
| 553| 553| 
| 554| 554| 	for (let evt of events.Destroy)
| 555| 555| 	{

binaries/data/mods/public/simulation/ai/petra/defenseArmy.js
| 651| }(PETRA);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'PETRA' was used before it was defined.
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 760| 760| 			if (targetState.garrisonHolder.garrisonedEntitiesCount + extraCount >= targetState.garrisonHolder.capacity)
| 761| 761| 				tooltip = coloredText(tooltip, "orange");
| 762| 762| 
| 763|    |-			//TODO check for attackTypes
|    | 763|+			// TODO check for attackTypes
| 764| 764| 			if (!MatchesClassList(entState.identity.classes, targetState.garrisonHolder.allowedClasses))
| 765| 765| 				return false;
| 766| 766| 

binaries/data/mods/public/gui/session/unit_actions.js
| 671| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (comma-spacing):
|    | There should be no space before ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Capturable.js
|  98|  98| 
|  99|  99| // Tests if the message is sent when capture points change
| 100| 100| testCapturable(testData, cmpCapturable => {
| 101|    |-	cmpCapturable.SetCapturePoints([0, 2000, 0 , 1000]);
|    | 101|+	cmpCapturable.SetCapturePoints([0, 2000, 0, 1000]);
| 102| 102| 	TS_ASSERT_UNEVAL_EQUALS(cmpCapturable.GetCapturePoints(), [0, 2000, 0, 1000]);
| 103| 103| 	Engine.PostMessage = function(ent, iid, message)
| 104| 104| 	{

binaries/data/mods/public/simulation/components/tests/test_Capturable.js
|  25| function·testCapturable(testData,·test_function)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'testData' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/tests/test_Capturable.js
| 132| function·testRegen(testData,·cpIn,·cpOut,·regenerating)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'testData' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/tests/test_Capturable.js
| 157| function·testDecay(testData,·cpIn,·cpOut)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'testData' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/tests/test_Capturable.js
| 176| function·testReduce(testData,·amount,·player,·taken)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'testData' is already declared in the upper scope.

binaries/data/mods/public/simulation/ai/common-api/entitycollection.js
| 310| }(API3);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'API3' was used before it was defined.

binaries/data/mods/public/simulation/ai/common-api/entitycollection.js
|  37| »   »   this._filters.push(eval(f));
|    | [NORMAL] JSHintBear:
|    | eval can be harmful.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|  69|  69| 	this.rallyPoint = rallyPoint;
|  70|  70| 	this.overseas = 0;
|  71|  71| 	if (gameState.ai.HQ.navalMap)
|  72|    |-	{
|    |  72|+	
|  73|  73| 		for (let structure of gameState.getEnemyStructures().values())
|  74|  74| 		{
|  75|  75| 			if (this.target && structure.id() != this.target.id())
| 101| 101| 				gameState.ai.HQ.navalManager.setMinimalTransportShips(gameState, sea, 1);
| 102| 102| 			}
| 103| 103| 		}
| 104|    |-	}
|    | 104|+	
| 105| 105| 	this.paused = false;
| 106| 106| 	this.maxCompletingTime = 0;
| 107| 107| 
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '='.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 139| 139| 	{
| 140| 140| 		priority = 90;
| 141| 141| 		// basically we want a mix of citizen soldiers so our barracks have a purpose, and champion units.
| 142|    |-		this.unitStat.RangedInfantry    = { "priority": 0.7, "minSize": 5, "targetSize": 20, "batchSize": 5, "classes": ["Infantry", "Ranged", "CitizenSoldier"],
|    | 142|+		this.unitStat.RangedInfantry = { "priority": 0.7, "minSize": 5, "targetSize": 20, "batchSize": 5, "classes": ["Infantry", "Ranged", "CitizenSoldier"],
| 143| 143| 			"interests": [["strength", 3]] };
| 144| 144| 		this.unitStat.MeleeInfantry     = { "priority": 0.7, "minSize": 5, "targetSize": 20, "batchSize": 5, "classes": ["Infantry", "Melee", "CitizenSoldier"],
| 145| 145| 			"interests": [["strength", 3]] };
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '='.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 141| 141| 		// basically we want a mix of citizen soldiers so our barracks have a purpose, and champion units.
| 142| 142| 		this.unitStat.RangedInfantry    = { "priority": 0.7, "minSize": 5, "targetSize": 20, "batchSize": 5, "classes": ["Infantry", "Ranged", "CitizenSoldier"],
| 143| 143| 			"interests": [["strength", 3]] };
| 144|    |-		this.unitStat.MeleeInfantry     = { "priority": 0.7, "minSize": 5, "targetSize": 20, "batchSize": 5, "classes": ["Infantry", "Melee", "CitizenSoldier"],
|    | 144|+		this.unitStat.MeleeInfantry = { "priority": 0.7, "minSize": 5, "targetSize": 20, "batchSize": 5, "classes": ["Infantry", "Melee", "CitizenSoldier"],
| 145| 145| 			"interests": [["strength", 3]] };
| 146| 146| 		this.unitStat.ChampRangedInfantry = { "priority": 1, "minSize": 3, "targetSize": 18, "batchSize": 3, "classes": ["Infantry", "Ranged", "Champion"],
| 147| 147| 			"interests": [["strength", 3]] };
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '='.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 145| 145| 			"interests": [["strength", 3]] };
| 146| 146| 		this.unitStat.ChampRangedInfantry = { "priority": 1, "minSize": 3, "targetSize": 18, "batchSize": 3, "classes": ["Infantry", "Ranged", "Champion"],
| 147| 147| 			"interests": [["strength", 3]] };
| 148|    |-		this.unitStat.ChampMeleeInfantry  = { "priority": 1, "minSize": 3, "targetSize": 18, "batchSize": 3, "classes": ["Infantry", "Melee", "Champion"],
|    | 148|+		this.unitStat.ChampMeleeInfantry = { "priority": 1, "minSize": 3, "targetSize": 18, "batchSize": 3, "classes": ["Infantry", "Melee", "Champion"],
| 149| 149| 			"interests": [["strength", 3]] };
| 150| 150| 		this.unitStat.RangedCavalry     = { "priority": 0.7, "minSize": 4, "targetSize": 20, "batchSize": 4, "classes": ["Cavalry", "Ranged", "CitizenSoldier"],
| 151| 151| 			"interests": [["strength", 2]] };
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '='.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 147| 147| 			"interests": [["strength", 3]] };
| 148| 148| 		this.unitStat.ChampMeleeInfantry  = { "priority": 1, "minSize": 3, "targetSize": 18, "batchSize": 3, "classes": ["Infantry", "Melee", "Champion"],
| 149| 149| 			"interests": [["strength", 3]] };
| 150|    |-		this.unitStat.RangedCavalry     = { "priority": 0.7, "minSize": 4, "targetSize": 20, "batchSize": 4, "classes": ["Cavalry", "Ranged", "CitizenSoldier"],
|    | 150|+		this.unitStat.RangedCavalry = { "priority": 0.7, "minSize": 4, "targetSize": 20, "batchSize": 4, "classes": ["Cavalry", "Ranged", "CitizenSoldier"],
| 151| 151| 			"interests": [["strength", 2]] };
| 152| 152| 		this.unitStat.MeleeCavalry      = { "priority": 0.7, "minSize": 4, "targetSize": 20, "batchSize": 4, "classes": ["Cavalry", "Melee", "CitizenSoldier"],
| 153| 153| 			"interests": [["strength", 2]] };
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '='.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 149| 149| 			"interests": [["strength", 3]] };
| 150| 150| 		this.unitStat.RangedCavalry     = { "priority": 0.7, "minSize": 4, "targetSize": 20, "batchSize": 4, "classes": ["Cavalry", "Ranged", "CitizenSoldier"],
| 151| 151| 			"interests": [["strength", 2]] };
| 152|    |-		this.unitStat.MeleeCavalry      = { "priority": 0.7, "minSize": 4, "targetSize": 20, "batchSize": 4, "classes": ["Cavalry", "Melee", "CitizenSoldier"],
|    | 152|+		this.unitStat.MeleeCavalry = { "priority": 0.7, "minSize": 4, "targetSize": 20, "batchSize": 4, "classes": ["Cavalry", "Melee", "CitizenSoldier"],
| 153| 153| 			"interests": [["strength", 2]] };
| 154| 154| 		this.unitStat.ChampRangedCavalry  = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Cavalry", "Ranged", "Champion"],
| 155| 155| 			"interests": [["strength", 3]] };
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '='.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 151| 151| 			"interests": [["strength", 2]] };
| 152| 152| 		this.unitStat.MeleeCavalry      = { "priority": 0.7, "minSize": 4, "targetSize": 20, "batchSize": 4, "classes": ["Cavalry", "Melee", "CitizenSoldier"],
| 153| 153| 			"interests": [["strength", 2]] };
| 154|    |-		this.unitStat.ChampRangedCavalry  = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Cavalry", "Ranged", "Champion"],
|    | 154|+		this.unitStat.ChampRangedCavalry = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Cavalry", "Ranged", "Champion"],
| 155| 155| 			"interests": [["strength", 3]] };
| 156| 156| 		this.unitStat.ChampMeleeCavalry   = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Cavalry", "Melee", "Champion"],
| 157| 157| 			"interests": [["strength", 2]] };
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '='.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 153| 153| 			"interests": [["strength", 2]] };
| 154| 154| 		this.unitStat.ChampRangedCavalry  = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Cavalry", "Ranged", "Champion"],
| 155| 155| 			"interests": [["strength", 3]] };
| 156|    |-		this.unitStat.ChampMeleeCavalry   = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Cavalry", "Melee", "Champion"],
|    | 156|+		this.unitStat.ChampMeleeCavalry = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Cavalry", "Melee", "Champion"],
| 157| 157| 			"interests": [["strength", 2]] };
| 158| 158| 		this.unitStat.Hero                = { "priority": 1, "minSize": 0, "targetSize":  1, "batchSize": 1, "classes": ["Hero"],
| 159| 159| 			"interests": [["strength", 2]] };
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '='.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 155| 155| 			"interests": [["strength", 3]] };
| 156| 156| 		this.unitStat.ChampMeleeCavalry   = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Cavalry", "Melee", "Champion"],
| 157| 157| 			"interests": [["strength", 2]] };
| 158|    |-		this.unitStat.Hero                = { "priority": 1, "minSize": 0, "targetSize":  1, "batchSize": 1, "classes": ["Hero"],
|    | 158|+		this.unitStat.Hero = { "priority": 1, "minSize": 0, "targetSize":  1, "batchSize": 1, "classes": ["Hero"],
| 159| 159| 			"interests": [["strength", 2]] };
| 160| 160| 		this.neededShips = 5;
| 161| 161| 	}
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space before value for key 'targetSize'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 155| 155| 			"interests": [["strength", 3]] };
| 156| 156| 		this.unitStat.ChampMeleeCavalry   = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Cavalry", "Melee", "Champion"],
| 157| 157| 			"interests": [["strength", 2]] };
| 158|    |-		this.unitStat.Hero                = { "priority": 1, "minSize": 0, "targetSize":  1, "batchSize": 1, "classes": ["Hero"],
|    | 158|+		this.unitStat.Hero                = { "priority": 1, "minSize": 0, "targetSize": 1, "batchSize": 1, "classes": ["Hero"],
| 159| 159| 			"interests": [["strength", 2]] };
| 160| 160| 		this.neededShips = 5;
| 161| 161| 	}
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '='.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 164| 164| 		priority = 70;
| 165| 165| 		this.unitStat.RangedInfantry = { "priority": 1, "minSize": 6, "targetSize": 16, "batchSize": 3, "classes": ["Infantry", "Ranged"],
| 166| 166| 			"interests": [["canGather", 1], ["strength", 1.6], ["costsResource", 0.3, "stone"], ["costsResource", 0.3, "metal"]] };
| 167|    |-		this.unitStat.MeleeInfantry  = { "priority": 1, "minSize": 6, "targetSize": 16, "batchSize": 3, "classes": ["Infantry", "Melee"],
|    | 167|+		this.unitStat.MeleeInfantry = { "priority": 1, "minSize": 6, "targetSize": 16, "batchSize": 3, "classes": ["Infantry", "Melee"],
| 168| 168| 			"interests": [["canGather", 1], ["strength", 1.6], ["costsResource", 0.3, "stone"], ["costsResource", 0.3, "metal"]] };
| 169| 169| 		this.unitStat.Cavalry = { "priority": 1, "minSize": 2, "targetSize": 6, "batchSize": 2, "classes": ["Cavalry", "CitizenSoldier"],
| 170| 170| 			"interests": [["strength", 1]] };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 399| 399| 	// the completing step is used to return resources and regroup the units
| 400| 400| 	// so we check that we have no more forced order before starting the attack
| 401| 401| 	if (this.state == "completing")
| 402|    |-	{
|    | 402|+	
| 403| 403| 		// if our target was destroyed, go back to "unexecuted" state
| 404| 404| 		if (this.targetPlayer === undefined || !this.target || !gameState.getEntityById(this.target.id()))
| 405| 405| 		{
| 416| 416| 				return 1;
| 417| 417| 			return 2;
| 418| 418| 		}
| 419|    |-	}
|    | 419|+	
| 420| 420| 
| 421| 421| 	if (this.Config.debug > 3 && gameState.ai.playedTurn % 50 === 0)
| 422| 422| 		this.debugAttack();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 525| 525| 
| 526| 526| 	// Remove those units which were in a temporary bombing attack
| 527| 527| 	for (let unitIds of gameState.ai.HQ.attackManager.bombingAttacks.values())
| 528|    |-	{
|    | 528|+	
| 529| 529| 		for (let entId of unitIds.values())
| 530| 530| 		{
| 531| 531| 			let ent = gameState.getEntityById(entId);
| 534| 534| 			unitIds.delete(entId);
| 535| 535| 			ent.stopMoving();
| 536| 536| 		}
| 537|    |-	}
|    | 537|+	
| 538| 538| 
| 539| 539| 	let rallyPoint = this.rallyPoint;
| 540| 540| 	let rallyIndex = gameState.ai.accessibility.getAccessValue(rallyPoint);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
| 872| 872| 			targets.addEnt(ent);
| 873| 873| 	}
| 874| 874| 	else
| 875|    |-	{
|    | 875|+	
| 876| 876| 		if (this.type == "Raid")
| 877| 877| 			targets = this.raidTargetFinder(gameState);
| 878| 878| 		else if (this.type == "Rush" || this.type == "Attack")
| 883| 883| 		}
| 884| 884| 		else
| 885| 885| 			targets = this.defaultTargetFinder(gameState, this.targetPlayer);
| 886|    |-	}
|    | 886|+	
| 887| 887| 	if (!targets.hasEntities())
| 888| 888| 		return undefined;
| 889| 889| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 0.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1143|1143| 
|1144|1144| 	if (blocker && blocker.hasClass("StoneWall"))
|1145|1145| 	{
|1146|    |-/*		if (this.hasSiegeUnits())
|    |1146|+		/*		if (this.hasSiegeUnits())
|1147|1147| 		{ */
|1148|1148| 			this.isBlocked = true;
|1149|1149| 			return blocker;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1145|1145| 	{
|1146|1146| /*		if (this.hasSiegeUnits())
|1147|1147| 		{ */
|1148|    |-			this.isBlocked = true;
|    |1148|+		this.isBlocked = true;
|1149|1149| 			return blocker;
|1150|1150| /*		}
|1151|1151| 		return undefined; */
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1146|1146| /*		if (this.hasSiegeUnits())
|1147|1147| 		{ */
|1148|1148| 			this.isBlocked = true;
|1149|    |-			return blocker;
|    |1149|+		return blocker;
|1150|1150| /*		}
|1151|1151| 		return undefined; */
|1152|1152| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 0.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1147|1147| 		{ */
|1148|1148| 			this.isBlocked = true;
|1149|1149| 			return blocker;
|1150|    |-/*		}
|    |1150|+		/*		}
|1151|1151| 		return undefined; */
|1152|1152| 	}
|1153|1153| 	else if (blocker)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1345|1345| 				}
|1346|1346| 			}
|1347|1347| 			else
|1348|    |-			{
|    |1348|+			
|1349|1349| 				if (this.isBlocked && !ourUnit.hasClass("Ranged") && attacker.hasClass("Ranged"))
|1350|1350| 				{
|1351|1351| 					// do not react if our melee units are attacked by ranged one and we are blocked by walls
|1398|1398| 					ourUnit.attack(attacker.id(), m.getPrefAttackTypes(gameState, ourUnit, attacker));
|1399|1399| 					ourUnit.setMetadata(PlayerID, "lastAttackPlanUpdateTime", time);
|1400|1400| 				}
|1401|    |-			}
|    |1401|+			
|1402|1402| 		}
|1403|1403| 
|1404|1404| 		let enemyUnits = gameState.getEnemyUnits(this.targetPlayer);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1347|1347| 			else
|1348|1348| 			{
|1349|1349| 				if (this.isBlocked && !ourUnit.hasClass("Ranged") && attacker.hasClass("Ranged"))
|1350|    |-				{
|    |1350|+				
|1351|1351| 					// do not react if our melee units are attacked by ranged one and we are blocked by walls
|1352|1352| 					// TODO check that the attacker is from behind the wall
|1353|1353| 					continue;
|1354|    |-				}
|    |1354|+				
|1355|1355| 				else if (m.isSiegeUnit(attacker))
|1356|1356| 				{	// if our unit is attacked by a siege unit, we'll send some melee units to help it.
|1357|1357| 					let collec = this.unitCollection.filter(API3.Filters.byClass("Melee")).filterNearest(ourUnit.position(), 5);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1390|1390| 							continue;
|1391|1391| 						let target = gameState.getEntityById(orderData[0].target);
|1392|1392| 						if (target && !target.hasClass("Structure") && !target.hasClass("Support"))
|1393|    |-						{
|    |1393|+						
|1394|1394| 							if (!target.hasClass("Ranged") || !attacker.hasClass("Melee"))
|1395|1395| 								continue;
|1396|    |-						}
|    |1396|+						
|1397|1397| 					}
|1398|1398| 					ourUnit.attack(attacker.id(), m.getPrefAttackTypes(gameState, ourUnit, attacker));
|1399|1399| 					ourUnit.setMetadata(PlayerID, "lastAttackPlanUpdateTime", time);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1418|1418| 			if (!target || target.hasClass("Structure"))
|1419|1419| 				continue;
|1420|1420| 			if (!(targetId in unitTargets))
|1421|    |-			{
|    |1421|+			
|1422|1422| 				if (m.isSiegeUnit(target) || target.hasClass("Hero"))
|1423|1423| 					unitTargets[targetId] = -8;
|1424|1424| 				else if (target.hasClass("Champion") || target.hasClass("Ship"))
|1425|1425| 					unitTargets[targetId] = -5;
|1426|1426| 				else
|1427|1427| 					unitTargets[targetId] = -3;
|1428|    |-			}
|    |1428|+			
|1429|1429| 			++unitTargets[targetId];
|1430|1430| 		}
|1431|1431| 		let veto = {};
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1438|1438| 		if (this.type == "Rush")
|1439|1439| 			targetClassesUnit = { "attack": ["Unit", "Structure"], "avoid": ["Palisade", "StoneWall", "Tower", "Fortress"], "vetoEntities": veto };
|1440|1440| 		else
|1441|    |-		{
|    |1441|+		
|1442|1442| 			if (this.target.hasClass("Fortress"))
|1443|1443| 				targetClassesUnit = { "attack": ["Unit", "Structure"], "avoid": ["Palisade", "StoneWall"], "vetoEntities": veto };
|1444|1444| 			else if (this.target.hasClass("Palisade") || this.target.hasClass("StoneWall"))
|1445|1445| 				targetClassesUnit = { "attack": ["Unit", "Structure"], "avoid": ["Fortress"], "vetoEntities": veto };
|1446|1446| 			else
|1447|1447| 				targetClassesUnit = { "attack": ["Unit", "Structure"], "avoid": ["Palisade", "StoneWall", "Fortress"], "vetoEntities": veto };
|1448|    |-		}
|    |1448|+		
|1449|1449| 		if (this.target.hasClass("Structure"))
|1450|1450| 			targetClassesSiege = { "attack": ["Structure"], "avoid": [], "vetoEntities": veto };
|1451|1451| 		else
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1529|1529| 			let range = 60;
|1530|1530| 			let attackTypes = ent.attackTypes();
|1531|1531| 			if (this.isBlocked)
|1532|    |-			{
|    |1532|+			
|1533|1533| 				if (attackTypes && attackTypes.indexOf("Ranged") !== -1)
|1534|1534| 					range = ent.attackRange("Ranged").max;
|1535|1535| 				else if (attackTypes && attackTypes.indexOf("Melee") !== -1)
|1536|1536| 					range = ent.attackRange("Melee").max;
|1537|1537| 				else
|1538|1538| 					range = 10;
|1539|    |-			}
|    |1539|+			
|1540|1540| 			else if (attackTypes && attackTypes.indexOf("Ranged") !== -1)
|1541|1541| 				range = 30 + ent.attackRange("Ranged").max;
|1542|1542| 			else if (ent.hasClass("Cavalry"))
|    | [NORMAL] ESLintBear (operator-assignment):
|    | Assignment can be replaced with operator assignment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1541|1541| 				range = 30 + ent.attackRange("Ranged").max;
|1542|1542| 			else if (ent.hasClass("Cavalry"))
|1543|1543| 				range += 30;
|1544|    |-			range = range * range;
|    |1544|+			range *= range;
|1545|1545| 			let entAccess = m.getLandAccess(gameState, ent);
|1546|1546| 			// Checking for gates if we're a siege unit.
|1547|1547| 			if (siegeUnit)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1585|1585| 					}
|1586|1586| 				}
|1587|1587| 				else
|1588|    |-				{
|    |1588|+				
|1589|1589| 					if (!ent.hasClass("Ranged"))
|1590|1590| 					{
|1591|1591| 						let targetClasses = { "attack": targetClassesSiege.attack, "avoid": targetClassesSiege.avoid.concat("Ship"), "vetoEntities": veto };
|1593|1593| 					}
|1594|1594| 					else
|1595|1595| 						ent.attackMove(this.targetPos[0], this.targetPos[1], targetClassesSiege);
|1596|    |-				}
|    |1596|+				
|1597|1597| 			}
|1598|1598| 			else
|1599|1599| 			{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1647|1647| 				{
|1648|1648| 					let targetClasses = targetClassesUnit;
|1649|1649| 					if (maybeUpdate && ent.unitAIState() === "INDIVIDUAL.COMBAT.APPROACHING")	// we may be blocked by walls, attack everything
|1650|    |-					{
|    |1650|+					
|1651|1651| 						if (!ent.hasClass("Ranged") && !ent.hasClass("Ship"))
|1652|1652| 							targetClasses = { "attack": ["Unit", "Structure"], "avoid": ["Ship"], "vetoEntities": veto };
|1653|1653| 						else
|1654|1654| 							targetClasses = { "attack": ["Unit", "Structure"], "vetoEntities": veto };
|1655|    |-					}
|    |1655|+					
|1656|1656| 					else if (!ent.hasClass("Ranged") && !ent.hasClass("Ship"))
|1657|1657| 						targetClasses = { "attack": targetClassesUnit.attack, "avoid": targetClassesUnit.avoid.concat("Ship"), "vetoEntities": veto };
|1658|1658| 					ent.attackMove(this.targetPos[0], this.targetPos[1], targetClasses);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1793|1793| 	}
|1794|1794| 	// Are we arrived at destination ?
|1795|1795| 	if (attackedNB > 1 && (attackedUnitNB || this.hasSiegeUnits()))
|1796|    |-	{
|    |1796|+	
|1797|1797| 		if (gameState.ai.HQ.territoryMap.getOwner(this.position) === this.targetPlayer || attackedNB > 3)
|1798|1798| 		{
|1799|1799| 			this.state = "arrived";
|1800|1800| 			return true;
|1801|1801| 		}
|1802|    |-	}
|    |1802|+	
|1803|1803| 
|1804|1804| 	// basically haven't moved an inch: very likely stuck)
|1805|1805| 	if (API3.SquareVectorDistance(this.position, this.position5TurnsAgo) < 10 && this.path.length > 0 && gameState.ai.playedTurn % 5 === 0)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|1919|1919| 			// Check if we could help any current attack
|1920|1920| 			let attackManager = gameState.ai.HQ.attackManager;
|1921|1921| 			for (let attackType in attackManager.startedAttacks)
|1922|    |-			{
|    |1922|+			
|1923|1923| 				for (let attack of attackManager.startedAttacks[attackType])
|1924|1924| 				{
|1925|1925| 					if (attack.name == this.name)
|1938|1938| 					this.targetPos = this.target.position();
|1939|1939| 					return true;
|1940|1940| 				}
|1941|    |-			}
|    |1941|+			
|1942|1942| 
|1943|1943| 			// If not, let's look for another enemy
|1944|1944| 			if (!this.target)

binaries/data/mods/public/simulation/ai/petra/attackPlan.js
|2171| }(PETRA);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'PETRA' was used before it was defined.
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
| 220| 220| 					"armorPercentage":
| 221| 221| 						'[font="sans-10"]' +
| 222| 222| 						sprintf(translate("(%(armorPercentage)s)"), {
| 223|    |-							"armorPercentage": armorLevelToPercentageString(template.armour[dmgType] || 0) //TODO capture?
|    | 223|+							"armorPercentage": armorLevelToPercentageString(template.armour[dmgType] || 0) // TODO capture?
| 224| 224| 						}) + '[/font]'
| 225| 225| 				})
| 226| 226| 			).join(commaFont(translate(", ")))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
| 247| 247| 	let tooltips = [];
| 248| 248| 	for (let type in template.attack)
| 249| 249| 	{
| 250|    |-		//if (type == "Slaughter")
|    | 250|+		// if (type == "Slaughter")
| 251| 251| 		//	continue; // Slaughter is used to kill animals, so do not show it.
| 252| 252| 
| 253| 253| 		let rate = sprintf(translate("%(label)s %(details)s"), {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
| 371| 371| function getRepairTimeTooltip(entState)
| 372| 372| {
| 373| 373| 	return sprintf(translate("%(label)s %(details)s"), {
| 374|    |-			"label": headerFont(translate("Number of repairers:")),
|    | 374|+		"label": headerFont(translate("Number of repairers:")),
| 375| 375| 			"details": entState.repairable.numBuilders
| 376| 376| 		}) + "\n" + (entState.repairable.numBuilders ?
| 377| 377| 		sprintf(translatePlural(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
| 372| 372| {
| 373| 373| 	return sprintf(translate("%(label)s %(details)s"), {
| 374| 374| 			"label": headerFont(translate("Number of repairers:")),
| 375|    |-			"details": entState.repairable.numBuilders
|    | 375|+		"details": entState.repairable.numBuilders
| 376| 376| 		}) + "\n" + (entState.repairable.numBuilders ?
| 377| 377| 		sprintf(translatePlural(
| 378| 378| 			"Add another worker to speed up the repairs by %(second)s second.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
| 373| 373| 	return sprintf(translate("%(label)s %(details)s"), {
| 374| 374| 			"label": headerFont(translate("Number of repairers:")),
| 375| 375| 			"details": entState.repairable.numBuilders
| 376|    |-		}) + "\n" + (entState.repairable.numBuilders ?
|    | 376|+	}) + "\n" + (entState.repairable.numBuilders ?
| 377| 377| 		sprintf(translatePlural(
| 378| 378| 			"Add another worker to speed up the repairs by %(second)s second.",
| 379| 379| 			"Add another worker to speed up the repairs by %(second)s seconds.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
| 393| 393| function getBuildTimeTooltip(entState)
| 394| 394| {
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396|    |-			"label": headerFont(translate("Number of builders:")),
|    | 396|+		"label": headerFont(translate("Number of builders:")),
| 397| 397| 			"details": entState.foundation.numBuilders
| 398| 398| 		}) + "\n" + (entState.foundation.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
| 394| 394| {
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396| 396| 			"label": headerFont(translate("Number of builders:")),
| 397|    |-			"details": entState.foundation.numBuilders
|    | 397|+		"details": entState.foundation.numBuilders
| 398| 398| 		}) + "\n" + (entState.foundation.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
| 400| 400| 			"Add another worker to speed up the construction by %(second)s second.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/tooltips.js
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396| 396| 			"label": headerFont(translate("Number of builders:")),
| 397| 397| 			"details": entState.foundation.numBuilders
| 398|    |-		}) + "\n" + (entState.foundation.numBuilders ?
|    | 398|+	}) + "\n" + (entState.foundation.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
| 400| 400| 			"Add another worker to speed up the construction by %(second)s second.",
| 401| 401| 			"Add another worker to speed up the construction by %(second)s seconds.",
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|  62|  62| 		targetPlayer = evt.player;
|  63|  63| 		let available = 0;
|  64|  64| 		for (let attackType in this.upcomingAttacks)
|  65|    |-		{
|    |  65|+		
|  66|  66| 			for (let attack of this.upcomingAttacks[attackType])
|  67|  67| 			{
|  68|  68| 				if (attack.state === "completing")
|  79|  79| 				if (attack.unitCollection.length > 2)
|  80|  80| 					available += attack.unitCollection.length;
|  81|  81| 			}
|  82|    |-		}
|    |  82|+		
|  83|  83| 
|  84|  84| 		if (available > 12)	// launch the attack immediately
|  85|  85| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|  84|  84| 		if (available > 12)	// launch the attack immediately
|  85|  85| 		{
|  86|  86| 			for (let attackType in this.upcomingAttacks)
|  87|    |-			{
|    |  87|+			
|  88|  88| 				for (let attack of this.upcomingAttacks[attackType])
|  89|  89| 				{
|  90|  90| 					if (attack.state === "completing" ||
|  94|  94| 					attack.forceStart();
|  95|  95| 					attack.requested = true;
|  96|  96| 				}
|  97|    |-			}
|    |  97|+			
|  98|  98| 			answer = "join";
|  99|  99| 		}
| 100| 100| 		else if (other !== undefined)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
| 105| 105| 		m.chatAnswerRequestAttack(gameState, targetPlayer, answer, other);
| 106| 106| 
| 107| 107| 	for (let evt of events.EntityRenamed)	// take care of packing units in bombing attacks
| 108|    |-	{
|    | 108|+	
| 109| 109| 		for (let [targetId, unitIds] of this.bombingAttacks)
| 110| 110| 		{
| 111| 111| 			if (targetId == evt.entity)
| 119| 119| 				unitIds.delete(evt.entity);
| 120| 120| 			}
| 121| 121| 		}
| 122|    |-	}
|    | 122|+	
| 123| 123| };
| 124| 124| 
| 125| 125| /**
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
| 107| 107| 	for (let evt of events.EntityRenamed)	// take care of packing units in bombing attacks
| 108| 108| 	{
| 109| 109| 		for (let [targetId, unitIds] of this.bombingAttacks)
| 110|    |-		{
|    | 110|+		
| 111| 111| 			if (targetId == evt.entity)
| 112| 112| 			{
| 113| 113| 				this.bombingAttacks.set(evt.newentity, unitIds);
| 118| 118| 				unitIds.add(evt.newentity);
| 119| 119| 				unitIds.delete(evt.entity);
| 120| 120| 			}
| 121|    |-		}
|    | 121|+		
| 122| 122| 	}
| 123| 123| };
| 124| 124| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
| 186| 186| 			let x;
| 187| 187| 			let z;
| 188| 188| 			if (struct.hasClass("Field"))
| 189|    |-			{
|    | 189|+			
| 190| 190| 				if (!struct.resourceSupplyNumGatherers() ||
| 191| 191| 				    !gameState.isPlayerEnemy(gameState.ai.HQ.territoryMap.getOwner(structPos)))
| 192| 192| 					continue;
| 193|    |-			}
|    | 193|+			
| 194| 194| 			let dist = API3.VectorDistance(entPos, structPos);
| 195| 195| 			if (dist > range)
| 196| 196| 			{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
| 254| 254| 
| 255| 255| 	let unexecutedAttacks = { "Rush": 0, "Raid": 0, "Attack": 0, "HugeAttack": 0 };
| 256| 256| 	for (let attackType in this.upcomingAttacks)
| 257|    |-	{
|    | 257|+	
| 258| 258| 		for (let i = 0; i < this.upcomingAttacks[attackType].length; ++i)
| 259| 259| 		{
| 260| 260| 			let attack = this.upcomingAttacks[attackType][i];
| 293| 293| 				this.upcomingAttacks[attackType].splice(i--, 1);
| 294| 294| 			}
| 295| 295| 		}
| 296|    |-	}
|    | 296|+	
| 297| 297| 
| 298| 298| 	for (let attackType in this.startedAttacks)
| 299| 299| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
| 296| 296| 	}
| 297| 297| 
| 298| 298| 	for (let attackType in this.startedAttacks)
| 299|    |-	{
|    | 299|+	
| 300| 300| 		for (let i = 0; i < this.startedAttacks[attackType].length; ++i)
| 301| 301| 		{
| 302| 302| 			let attack = this.startedAttacks[attackType][i];
| 313| 313| 				this.startedAttacks[attackType].splice(i--, 1);
| 314| 314| 			}
| 315| 315| 		}
| 316|    |-	}
|    | 316|+	
| 317| 317| 
| 318| 318| 	// creating plans after updating because an aborted plan might be reused in that case.
| 319| 319| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
| 339| 339| 	else if (unexecutedAttacks.Attack == 0 && unexecutedAttacks.HugeAttack == 0 &&
| 340| 340| 		this.startedAttacks.Attack.length + this.startedAttacks.HugeAttack.length < Math.min(2, 1 + Math.round(gameState.getPopulationMax()/100)) &&
| 341| 341| 		(this.startedAttacks.Attack.length + this.startedAttacks.HugeAttack.length == 0 || gameState.getPopulationMax() - gameState.getPopulation() > 12))
| 342|    |-	{
|    | 342|+	
| 343| 343| 		if (barracksNb >= 1 && (gameState.currentPhase() > 1 || gameState.isResearching(gameState.getPhaseName(2))) ||
| 344| 344| 			!gameState.ai.HQ.baseManagers[1])	// if we have no base ... nothing else to do than attack
| 345| 345| 		{
| 357| 357| 			}
| 358| 358| 			this.attackNumber++;
| 359| 359| 		}
| 360|    |-	}
|    | 360|+	
| 361| 361| 
| 362| 362| 	if (unexecutedAttacks.Raid === 0 && gameState.ai.HQ.defenseManager.targetList.length)
| 363| 363| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
| 383| 383| m.AttackManager.prototype.getPlan = function(planName)
| 384| 384| {
| 385| 385| 	for (let attackType in this.upcomingAttacks)
| 386|    |-	{
|    | 386|+	
| 387| 387| 		for (let attack of this.upcomingAttacks[attackType])
| 388| 388| 			if (attack.getName() == planName)
| 389| 389| 				return attack;
| 390|    |-	}
|    | 390|+	
| 391| 391| 	for (let attackType in this.startedAttacks)
| 392| 392| 	{
| 393| 393| 		for (let attack of this.startedAttacks[attackType])
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
| 389| 389| 				return attack;
| 390| 390| 	}
| 391| 391| 	for (let attackType in this.startedAttacks)
| 392|    |-	{
|    | 392|+	
| 393| 393| 		for (let attack of this.startedAttacks[attackType])
| 394| 394| 			if (attack.getName() == planName)
| 395| 395| 				return attack;
| 396|    |-	}
|    | 396|+	
| 397| 397| 	return undefined;
| 398| 398| };
| 399| 399| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
| 465| 465| 		veto[i] = true;
| 466| 466| 	// No rush if enemy too well defended (i.e. iberians)
| 467| 467| 	if (attack.type == "Rush")
| 468|    |-	{
|    | 468|+	
| 469| 469| 		for (let i = 1; i < gameState.sharedScript.playersData.length; ++i)
| 470| 470| 		{
| 471| 471| 			if (!gameState.isPlayerEnemy(i) || veto[i])
| 479| 479| 			if (enemyDefense > 6)
| 480| 480| 				veto[i] = true;
| 481| 481| 		}
| 482|    |-	}
|    | 482|+	
| 483| 483| 
| 484| 484| 	// then if not a huge attack, continue attacking our previous target as long as it has some entities,
| 485| 485| 	// otherwise target the most accessible one

binaries/data/mods/public/simulation/ai/petra/attackManager.js
| 805| }(PETRA);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'PETRA' was used before it was defined.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
|  49|  49| 					break;
|  50|  50| 				}
|  51|  51| 				if (!hasDropsite)
|  52|    |-				{
|    |  52|+				
|  53|  53| 					for (let unit of gameState.getOwnUnits().filter(API3.Filters.byClass("Support")).values())
|  54|  54| 					{
|  55|  55| 						if (!unit.position() || m.getLandAccess(gameState, unit) != plan.endIndex)
|  60|  60| 						hasDropsite = true;
|  61|  61| 						break;
|  62|  62| 					}
|  63|    |-				}
|    |  63|+				
|  64|  64| 				if (!hasDropsite)
|  65|  65| 					plan.removeUnit(gameState, ent);
|  66|  66| 			}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
| 206| 206| 			// TODO if we already carry the max we can ->  returnresources
| 207| 207| 			if (!ent.resourceCarrying() || !ent.resourceCarrying().length ||
| 208| 208| 				ent.resourceCarrying()[0].type == ent.getMetadata(PlayerID, "gather-type"))
| 209|    |-			{
|    | 209|+			
| 210| 210| 				this.startGathering(gameState);
| 211|    |-			}
|    | 211|+			
| 212| 212| 			else if (!m.returnResources(gameState, ent))     // try to deposit resources
| 213| 213| 			{
| 214| 214| 				// no dropsite, abandon old resources and start gathering new ones
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
| 210| 210| 				this.startGathering(gameState);
| 211| 211| 			}
| 212| 212| 			else if (!m.returnResources(gameState, ent))     // try to deposit resources
| 213|    |-			{
|    | 213|+			
| 214| 214| 				// no dropsite, abandon old resources and start gathering new ones
| 215| 215| 				this.startGathering(gameState);
| 216|    |-			}
|    | 216|+			
| 217| 217| 		}
| 218| 218| 		else if (unitAIStateOrder == "GATHER")
| 219| 219| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
| 281| 281| 				{
| 282| 282| 					let nearby = this.base.dropsiteSupplies[gatherType].nearby;
| 283| 283| 					if (!nearby.some(sup => sup.id == supplyId))
| 284|    |-					{
|    | 284|+					
| 285| 285| 						if (nearby.length)
| 286| 286| 							ent.setMetadata(PlayerID, "supply", undefined);
| 287| 287| 						else
| 290| 290| 							if (!medium.some(sup => sup.id == supplyId) && medium.length)
| 291| 291| 								ent.setMetadata(PlayerID, "supply", undefined);
| 292| 292| 						}
| 293|    |-					}
|    | 293|+					
| 294| 294| 				}
| 295| 295| 			}
| 296| 296| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
| 386| 386| 			}
| 387| 387| 		}
| 388| 388| 		else	// Perform some sanity checks
| 389|    |-		{
|    | 389|+		
| 390| 390| 			if (unitAIStateOrder == "GATHER" || unitAIStateOrder == "RETURNRESOURCE")
| 391| 391| 			{
| 392| 392| 				// we may have drifted towards ennemy territory during the hunt, if yes go home
| 401| 401| 						m.returnResources(gameState, ent);
| 402| 402| 				}
| 403| 403| 			}
| 404|    |-		}
|    | 404|+		
| 405| 405| 	}
| 406| 406| 	else if (subrole == "fisher")
| 407| 407| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
| 404| 404| 		}
| 405| 405| 	}
| 406| 406| 	else if (subrole == "fisher")
| 407|    |-	{
|    | 407|+	
| 408| 408| 		if (ent.isIdle())
| 409| 409| 			this.startFishing(gameState);
| 410| 410| 		else	// if we have drifted towards ennemy territory during the fishing, go home
| 413| 413| 			if (territoryOwner != 0 && !gameState.isPlayerAlly(territoryOwner))  // player is its own ally
| 414| 414| 				this.startFishing(gameState);
| 415| 415| 		}
| 416|    |-	}
|    | 416|+	
| 417| 417| };
| 418| 418| 
| 419| 419| m.Worker.prototype.retryWorking = function(gameState, subrole)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
| 544| 544| 		}
| 545| 545| 	}
| 546| 546| 	if (resource == "food")	// --> for food, try to gather from fields if any, otherwise build one if any
| 547|    |-	{
|    | 547|+	
| 548| 548| 		for (let base of gameState.ai.HQ.baseManagers)
| 549| 549| 		{
| 550| 550| 			if (base.ID == this.baseID)
| 566| 566| 				return true;
| 567| 567| 			}
| 568| 568| 		}
| 569|    |-	}
|    | 569|+	
| 570| 570| 	for (let base of gameState.ai.HQ.baseManagers)
| 571| 571| 	{
| 572| 572| 		if (base.ID == this.baseID)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js
| 617| 617| 		}
| 618| 618| 	}
| 619| 619| 	if (resource == "food")	// --> for food, try to gather from fields if any, otherwise build one if any
| 620|    |-	{
|    | 620|+	
| 621| 621| 		for (let base of gameState.ai.HQ.baseManagers)
| 622| 622| 		{
| 623| 623| 			if (base.accessIndex == this.entAccess)
| 637| 637| 				return true;
| 638| 638| 			}
| 639| 639| 		}
| 640|    |-	}
|    | 640|+	
| 641| 641| 	for (let base of gameState.ai.HQ.baseManagers)
| 642| 642| 	{
| 643| 643| 		if (base.accessIndex == this.entAccess)

binaries/data/mods/public/simulation/ai/petra/worker.js
|1114| }(PETRA);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'PETRA' was used before it was defined.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/entityExtend.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/entityExtend.js
| 333| 333| m.getHolder = function(gameState, ent)
| 334| 334| {
| 335| 335| 	for (let holder of gameState.getEntities().values())
| 336|    |-	{
|    | 336|+	
| 337| 337| 		if (holder.isGarrisonHolder() && holder.garrisoned().indexOf(ent.id()) !== -1)
| 338| 338| 			return holder;
| 339|    |-	}
|    | 339|+	
| 340| 340| 	return undefined;
| 341| 341| };
| 342| 342| 

binaries/data/mods/public/simulation/ai/petra/entityExtend.js
| 449| }(PETRA);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'PETRA' was used before it was defined.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
|  52|  52| 		}
|  53|  53| 	}
|  54|  54| 	for (let enemy in attackingArmies)
|  55|    |-	{
|    |  55|+	
|  56|  56| 		for (let ally in attackingArmies[enemy])
|  57|  57| 		{
|  58|  58| 			if (this.attackedAllies[ally] === undefined)
|  59|  59| 				this.attackedAllies[ally] = 0;
|  60|  60| 			this.attackedAllies[ally] += 1;
|  61|  61| 		}
|  62|    |-	}
|    |  62|+	
|  63|  63| 	this.checkEnemyArmies(gameState);
|  64|  64| 	this.checkEnemyUnits(gameState);
|  65|  65| 	this.assignDefenders(gameState);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
|  70|  70| m.DefenseManager.prototype.makeIntoArmy = function(gameState, entityID, type = "default")
|  71|  71| {
|  72|  72| 	if (type == "default")
|  73|    |-	{
|    |  73|+	
|  74|  74| 		// Try to add it to an existing army.
|  75|  75| 		for (let army of this.armies)
|  76|  76| 			if (army.getType() == type && army.addFoe(gameState, entityID))
|  77|  77| 				return;	// over
|  78|    |-	}
|    |  78|+	
|  79|  79| 
|  80|  80| 	// Create a new army for it.
|  81|  81| 	let army = new m.DefenseArmy(gameState, [entityID], type);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
| 179| 179| 		if (territoryOwner != PlayerID && this.attackedAllies[territoryOwner] &&
| 180| 180| 		                                  this.attackedAllies[territoryOwner] > 1 &&
| 181| 181| 		                                  this.GetCooperationLevel(territoryOwner) > 0.7)
| 182|    |-		{
|    | 182|+		
| 183| 183| 			for (let building of gameState.getAllyStructures(territoryOwner).values())
| 184| 184| 			{
| 185| 185| 				if (building.foundationProgress() == 0 ||
| 188| 188| 				if (!this.territoryMap.isBlinking(building.position()))
| 189| 189| 					return true;
| 190| 190| 			}
| 191|    |-		}
|    | 191|+		
| 192| 192| 
| 193| 193| 		// Update the number of enemies attacking this ally
| 194| 194| 		let enemy = entity.owner();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
| 211| 211| 	if (i == PlayerID)
| 212| 212| 	{
| 213| 213| 		if (!this.armies.length)
| 214|    |-		{
|    | 214|+		
| 215| 215| 			// check if we can recover capture points from any of our notdecaying structures
| 216| 216| 			for (let ent of gameState.getOwnStructures().values())
| 217| 217| 			{
| 229| 229| 				this.makeIntoArmy(gameState, ent.id(), "capturing");
| 230| 230| 				break;
| 231| 231| 			}
| 232|    |-		}
|    | 232|+		
| 233| 233| 		return;
| 234| 234| 	}
| 235| 235| 	else if (!gameState.isPlayerEnemy(i))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
| 328| 328| 		if (!gameState.isPlayerEnemy(owner))
| 329| 329| 		{
| 330| 330| 			if (gameState.isPlayerMutualAlly(owner))
| 331|    |-			{
|    | 331|+			
| 332| 332| 				// update the number of enemies attacking this ally
| 333| 333| 				for (let id of army.foeEntities)
| 334| 334| 				{
| 343| 343| 					this.attackingArmies[enemy][owner] += 1;
| 344| 344| 					break;
| 345| 345| 				}
| 346|    |-			}
|    | 346|+			
| 347| 347| 			continue;
| 348| 348| 		}
| 349| 349| 		else if (owner != 0)   // enemy army back in its territory
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
| 530| 530| 		army.checkEvents(gameState, events);
| 531| 531| 
| 532| 532| 	for (let evt of events.OwnershipChanged)   // capture events
| 533|    |-	{
|    | 533|+	
| 534| 534| 		if (gameState.isPlayerMutualAlly(evt.from) && evt.to > 0)
| 535| 535| 		{
| 536| 536| 			let ent = gameState.getEntityById(evt.entity);
| 537| 537| 			if (ent && ent.hasClass("CivCentre")) // one of our cc has been captured
| 538| 538| 				gameState.ai.HQ.attackManager.switchDefenseToAttack(gameState, ent, { "range": 150 });
| 539| 539| 		}
| 540|    |-	}
|    | 540|+	
| 541| 541| 
| 542| 542| 	let allAttacked = {};
| 543| 543| 	for (let evt of events.Attacked)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
| 552| 552| 		let attacker = gameState.getEntityById(evt.attacker);
| 553| 553| 		if (attacker && gameState.isEntityOwn(attacker) && gameState.isEntityEnemy(target) && !attacker.hasClass("Ship") &&
| 554| 554| 		   (!target.hasClass("Structure") || target.attackRange("Ranged")))
| 555|    |-		{
|    | 555|+		
| 556| 556| 			// If enemies are in range of one of our defensive structures, garrison it for arrow multiplier
| 557| 557| 			// (enemy non-defensive structure are not considered to stay in sync with garrisonManager)
| 558| 558| 			if (attacker.position() && attacker.isGarrisonHolder() && attacker.getArrowMultiplier() &&
| 559| 559| 			    (target.owner() != 0 || !target.hasClass("Unit") ||
| 560| 560| 			     target.unitAIState() && target.unitAIState().split(".")[1] == "COMBAT"))
| 561| 561| 				this.garrisonUnitsInside(gameState, attacker, { "attacker": target });
| 562|    |-		}
|    | 562|+		
| 563| 563| 
| 564| 564| 		if (!gameState.isEntityOwn(target))
| 565| 565| 			continue;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js
| 756| 756| 	let typeGarrison = data.type || "protection";
| 757| 757| 	let allowMelee = gameState.ai.HQ.garrisonManager.allowMelee(target);
| 758| 758| 	if (allowMelee === undefined)
| 759|    |-	{
|    | 759|+	
| 760| 760| 		// Should be kept in sync with garrisonManager to avoid garrisoning-ungarrisoning some units
| 761| 761| 		if (data.attacker)
| 762| 762| 			allowMelee = data.attacker.hasClass("Structure") ? data.attacker.attackRange("Ranged") : !m.isSiegeUnit(data.attacker);
| 763| 763| 		else
| 764| 764| 			allowMelee = true;
| 765|    |-	}
|    | 765|+	
| 766| 766| 	let units = gameState.getOwnUnits().filter(ent => {
| 767| 767| 		if (!ent.position())
| 768| 768| 			return false;

binaries/data/mods/public/simulation/ai/petra/defenseManager.js
| 957| }(PETRA);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'PETRA' was used before it was defined.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|  66|  66| 		let phase = "";
|  67|  67| 		let cmpTechnologyManager = QueryPlayerIDInterface(i, IID_TechnologyManager);
|  68|  68| 		if (cmpTechnologyManager)
|  69|    |-		{
|    |  69|+		
|  70|  70| 			if (cmpTechnologyManager.IsTechnologyResearched("phase_city"))
|  71|  71| 				phase = "city";
|  72|  72| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_town"))
|  73|  73| 				phase = "town";
|  74|  74| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_village"))
|  75|  75| 				phase = "village";
|  76|    |-		}
|    |  76|+		
|  77|  77| 
|  78|  78| 		// store player ally/neutral/enemy data as arrays
|  79|  79| 		let allies = [];
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'cmpAttack'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
| 389| 389| 		for (let type of types)
| 390| 390| 		{
| 391| 391| 			ret.attack[type] = {};
| 392|    |-			ret.attack[type].tooltipHeader =  cmpAttack.GetTooltipHeader(type);
|    | 392|+			ret.attack[type].tooltipHeader = cmpAttack.GetTooltipHeader(type);
| 393| 393| 			ret.attack[type].damage = cmpAttack.GetAttackStrengths(type);
| 394| 394| 
| 395| 395| 			ret.attack[type].splash = cmpAttack.GetSplashDamage(type);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
| 406| 406| 			ret.attack[type].projectile = cmpAttack.HasProjectile(type);
| 407| 407| 
| 408| 408| 			if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
| 409|    |-			{
|    | 409|+			
| 410| 410| 				// For units, take the range in front of it, no spread. So angle = 0
| 411| 411| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 412|    |-			}
|    | 412|+			
| 413| 413| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 414| 414| 			{
| 415| 415| 				// For buildings, take the average elevation around it. So angle = 2*pi
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
| 411| 411| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 412| 412| 			}
| 413| 413| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 414|    |-			{
|    | 414|+			
| 415| 415| 				// For buildings, take the average elevation around it. So angle = 2*pi
| 416| 416| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 417|    |-			}
|    | 417|+			
| 418| 418| 			else
| 419| 419| 			{
| 420| 420| 				// not in world, set a default?
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
| 416| 416| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 417| 417| 			}
| 418| 418| 			else
| 419|    |-			{
|    | 419|+			
| 420| 420| 				// not in world, set a default?
| 421| 421| 				ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
| 422|    |-			}
|    | 422|+			
| 423| 423| 		}
| 424| 424| 	}
| 425| 425| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
| 787| 787| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 788| 788| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 789| 789| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 790|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 790|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 791| 791| 	}
| 792| 792| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 793| 793| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1306|1306| 		}
|1307|1307| 	}
|1308|1308| 	else
|1309|    |-	{
|    |1309|+	
|1310|1310| 		// Didn't snap to an existing entity, add the starting tower manually. To prevent odd-looking rotation jumps
|1311|1311| 		// when shift-clicking to build a wall, reuse the placement angle that was last seen on a validly positioned
|1312|1312| 		// wall piece.
|1327|1327| 			"pos": start.pos,
|1328|1328| 			"angle": previewEntities.length > 0 ? previewEntities[0].angle : this.placementWallLastAngle
|1329|1329| 		});
|1330|    |-	}
|    |1330|+	
|1331|1331| 
|1332|1332| 	if (end.pos)
|1333|1333| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1330|1330| 	}
|1331|1331| 
|1332|1332| 	if (end.pos)
|1333|    |-	{
|    |1333|+	
|1334|1334| 		// Analogous to the starting side case above
|1335|1335| 		if (end.snappedEnt && end.snappedEnt != INVALID_ENTITY)
|1336|1336| 		{
|1368|1368| 				"pos": end.pos,
|1369|1369| 				"angle": previewEntities.length > 0 ? previewEntities[previewEntities.length-1].angle : this.placementWallLastAngle
|1370|1370| 			});
|1371|    |-	}
|    |1371|+	
|1372|1372| 
|1373|1373| 	let cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain);
|1374|1374| 	if (!cmpTerrain)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1546|1546| 
|1547|1547| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
|1548|1548| 		if (cmpVisual)
|1549|    |-		{
|    |1549|+		
|1550|1550| 			if (!allPiecesValid || !canAfford)
|1551|1551| 				cmpVisual.SetShadingColor(1.4, 0.4, 0.4, 1);
|1552|1552| 			else
|1553|1553| 				cmpVisual.SetShadingColor(1, 1, 1, 1);
|1554|    |-		}
|    |1554|+		
|1555|1555| 
|1556|1556| 		++entPool.numUsed;
|1557|1557| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1620|1620| 			{
|1621|1621| 				minDist2 = dist2;
|1622|1622| 				minDistEntitySnapData = {
|1623|    |-						"x": pos.x,
|    |1623|+					"x": pos.x,
|1624|1624| 						"z": pos.z,
|1625|1625| 						"angle": cmpPosition.GetRotation().y,
|1626|1626| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1621|1621| 				minDist2 = dist2;
|1622|1622| 				minDistEntitySnapData = {
|1623|1623| 						"x": pos.x,
|1624|    |-						"z": pos.z,
|    |1624|+					"z": pos.z,
|1625|1625| 						"angle": cmpPosition.GetRotation().y,
|1626|1626| 						"ent": ent
|1627|1627| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1622|1622| 				minDistEntitySnapData = {
|1623|1623| 						"x": pos.x,
|1624|1624| 						"z": pos.z,
|1625|    |-						"angle": cmpPosition.GetRotation().y,
|    |1625|+					"angle": cmpPosition.GetRotation().y,
|1626|1626| 						"ent": ent
|1627|1627| 				};
|1628|1628| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1623|1623| 						"x": pos.x,
|1624|1624| 						"z": pos.z,
|1625|1625| 						"angle": cmpPosition.GetRotation().y,
|1626|    |-						"ent": ent
|    |1626|+					"ent": ent
|1627|1627| 				};
|1628|1628| 			}
|1629|1629| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1768|1768| 			result.gain = cmpEntityTrader.GetGoods().amount;
|1769|1769| 	}
|1770|1770| 	else if (data.target === secondMarket)
|1771|    |-	{
|    |1771|+	
|1772|1772| 		result = {
|1773|1773| 			"type": "is second",
|1774|1774| 			"gain": cmpEntityTrader.GetGoods().amount,
|1775|1775| 		};
|1776|    |-	}
|    |1776|+	
|1777|1777| 	else if (!firstMarket)
|1778|1778| 	{
|1779|1779| 		result = { "type": "set first" };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1775|1775| 		};
|1776|1776| 	}
|1777|1777| 	else if (!firstMarket)
|1778|    |-	{
|    |1778|+	
|1779|1779| 		result = { "type": "set first" };
|1780|    |-	}
|    |1780|+	
|1781|1781| 	else if (!secondMarket)
|1782|1782| 	{
|1783|1783| 		result = {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1779|1779| 		result = { "type": "set first" };
|1780|1780| 	}
|1781|1781| 	else if (!secondMarket)
|1782|    |-	{
|    |1782|+	
|1783|1783| 		result = {
|1784|1784| 			"type": "set second",
|1785|1785| 			"gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),
|1786|1786| 		};
|1787|    |-	}
|    |1787|+	
|1788|1788| 	else
|1789|1789| 	{
|1790|1790| 		// Else both markets are not null and target is different from them
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1786|1786| 		};
|1787|1787| 	}
|1788|1788| 	else
|1789|    |-	{
|    |1789|+	
|1790|1790| 		// Else both markets are not null and target is different from them
|1791|1791| 		result = { "type": "set first" };
|1792|    |-	}
|    |1792|+	
|1793|1793| 	return result;
|1794|1794| };
|1795|1795| 

binaries/data/mods/public/maps/random/survivalofthefittest_triggers.js
| 275| »   for·(let·point·of·triggerPoints)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'point' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/common-api/entity.js
|  33|  33| 		{
|  34|  34| 			let args = string.split("/");
|  35|  35| 			for (let arg of args)
|  36|    |-			{
|    |  36|+			
|  37|  37| 				if (value[arg])
|  38|  38| 					value = value[arg];
|  39|  39| 				else
|  41|  41| 					value = undefined;
|  42|  42| 					break;
|  43|  43| 				}
|  44|    |-			}
|    |  44|+			
|  45|  45| 			this._tpCache.set(string, value);
|  46|  46| 		}
|  47|  47| 		return this._tpCache.get(string);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/common-api/entity.js
| 303| 303| 			return undefined;
| 304| 304| 
| 305| 305| 		if (this.get("Attack/" + type + "/Bonuses"))
| 306|    |-		{
|    | 306|+		
| 307| 307| 			for (let b in this.get("Attack/" + type + "/Bonuses"))
| 308| 308| 			{
| 309| 309| 				let bonusClasses = this.get("Attack/" + type + "/Bonuses/" + b + "/Classes");
| 313| 313| 					if (bcl == againstClass)
| 314| 314| 						return +this.get("Attack/" + type + "/Bonuses/" + b + "/Multiplier");
| 315| 315| 			}
| 316|    |-		}
|    | 316|+		
| 317| 317| 		return 1;
| 318| 318| 	},
| 319| 319| 
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/common-api/entity.js
| 520| 520| 	 */
| 521| 521| 	"canCapture": function(target)
| 522| 522| 	{
| 523|    |-		if (!this.get("Attack/Capture")) //TODO
|    | 523|+		if (!this.get("Attack/Capture")) // TODO
| 524| 524| 			return false;
| 525| 525| 		if (!target)
| 526| 526| 			return true;

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 793| »   »   if·(this.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 810| »   »   if·(this.position()·!==·undefined·&&·unitToFleeFrom.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 940| }(API3);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'API3' was used before it was defined.
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '9'.
|----|    | /zpool0/trunk/binaries/data/mods/public/maps/random/jebel_barkal_triggers.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/maps/random/jebel_barkal_triggers.js
| 120| 120| var jebelBarkal_firstAttackTime = (difficulty, isNomad) =>
| 121| 121| 	jebelBarkal_attackInterval(0, difficulty) +
| 122| 122| 	2 * Math.max(0, 3 - difficulty) +
| 123|    |-	(isNomad ?  9 - difficulty : 0);
|    | 123|+	(isNomad ? 9 - difficulty : 0);
| 124| 124| 
| 125| 125| /**
| 126| 126|  * Account for varying mapsizes and number of players when spawning attackers.

binaries/data/mods/public/maps/random/jebel_barkal_triggers.js
| 639| {
|    | [NORMAL] ESLintBear (no-lone-blocks):
|    | Block is redundant.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/victoryManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/victoryManager.js
|  27|  27| m.VictoryManager.prototype.init = function(gameState)
|  28|  28| {
|  29|  29| 	if (gameState.getVictoryConditions().has("wonder"))
|  30|    |-	{
|    |  30|+	
|  31|  31| 		for (let wonder of gameState.getOwnEntitiesByClass("Wonder", true).values())
|  32|  32| 			this.criticalEnts.set(wonder.id(), { "guardsAssigned": 0, "guards": new Map() });
|  33|    |-	}
|    |  33|+	
|  34|  34| 
|  35|  35| 	if (gameState.getVictoryConditions().has("regicide"))
|  36|  36| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/victoryManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/victoryManager.js
|  33|  33| 	}
|  34|  34| 
|  35|  35| 	if (gameState.getVictoryConditions().has("regicide"))
|  36|    |-	{
|    |  36|+	
|  37|  37| 		for (let hero of gameState.getOwnEntitiesByClass("Hero", true).values())
|  38|  38| 		{
|  39|  39| 			let defaultStance = hero.hasClass("Soldier") ? "aggressive" : "passive";
|  46|  46| 				"guards": new Map() // ids of ents who are currently guarding this hero
|  47|  47| 			});
|  48|  48| 		}
|  49|    |-	}
|    |  49|+	
|  50|  50| 
|  51|  51| 	if (gameState.getVictoryConditions().has("capture_the_relic"))
|  52|  52| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/victoryManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/victoryManager.js
|  49|  49| 	}
|  50|  50| 
|  51|  51| 	if (gameState.getVictoryConditions().has("capture_the_relic"))
|  52|    |-	{
|    |  52|+	
|  53|  53| 		for (let relic of gameState.updatingGlobalCollection("allRelics", API3.Filters.byClass("Relic")).values())
|  54|  54| 		{
|  55|  55| 			if (relic.owner() == PlayerID)
|  56|  56| 				this.criticalEnts.set(relic.id(), { "guardsAssigned": 0, "guards": new Map() });
|  57|  57| 		}
|  58|    |-	}
|    |  58|+	
|  59|  59| };
|  60|  60| 
|  61|  61| /**
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/victoryManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/victoryManager.js
|  51|  51| 	if (gameState.getVictoryConditions().has("capture_the_relic"))
|  52|  52| 	{
|  53|  53| 		for (let relic of gameState.updatingGlobalCollection("allRelics", API3.Filters.byClass("Relic")).values())
|  54|    |-		{
|    |  54|+		
|  55|  55| 			if (relic.owner() == PlayerID)
|  56|  56| 				this.criticalEnts.set(relic.id(), { "guardsAssigned": 0, "guards": new Map() });
|  57|    |-		}
|    |  57|+		
|  58|  58| 	}
|  59|  59| };
|  60|  60| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/victoryManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/victoryManager.js
| 359| 359| {
| 360| 360| 	let numWorkers = gameState.getOwnEntitiesByRole("worker", true).length;
| 361| 361| 	if (numWorkers < 20)
| 362|    |-	{
|    | 362|+	
| 363| 363| 		for (let data of this.criticalEnts.values())
| 364| 364| 		{
| 365| 365| 			for (let guardId of data.guards.keys())
| 384| 384| 			if (numWorkers >= 20)
| 385| 385| 				break;
| 386| 386| 		}
| 387|    |-	}
|    | 387|+	
| 388| 388| 
| 389| 389| 	let minWorkers = 25;
| 390| 390| 	let deltaWorkers = 3;

binaries/data/mods/public/simulation/ai/petra/victoryManager.js
| 748| }(PETRA);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'PETRA' was used before it was defined.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 325| 325| 			{
| 326| 326| 				var list = queue.GetEntitiesList();
| 327| 327| 				if (list.indexOf(cmd.template) === -1 && cmd.promoted)
| 328|    |-				{
|    | 328|+				
| 329| 329| 					for (var promoted of cmd.promoted)
| 330| 330| 					{
| 331| 331| 						if (list.indexOf(promoted) === -1)
| 333| 333| 						cmd.template = promoted;
| 334| 334| 						break;
| 335| 335| 					}
| 336|    |-				}
|    | 336|+				
| 337| 337| 			}
| 338| 338| 			if (queue && queue.GetEntitiesList().indexOf(cmd.template) != -1)
| 339| 339| 				if ("metadata" in cmd)
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 532| 532| 			if (cmpGarrisonHolder)
| 533| 533| 			{
| 534| 534| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 535|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 536|    |-				    && player != +cmd.owner)
|    | 535|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 536|+				    player != +cmd.owner)
| 537| 537| 						continue;
| 538| 538| 
| 539| 539| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 534| 534| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 535| 535| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 536| 536| 				    && player != +cmd.owner)
| 537|    |-						continue;
|    | 537|+					continue;
| 538| 538| 
| 539| 539| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 540| 540| 					notifyUnloadFailure(player, garrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 944| 944| 		{
| 945| 945| 			var count = 0;
| 946| 946| 			for (let j = 0; j < length - 1; ++j)
| 947|    |-			{
|    | 947|+			
| 948| 948| 				if ((waterPoints[(i + j) % length] + 1) % numPoints == waterPoints[(i + j + 1) % length])
| 949| 949| 					++count;
| 950| 950| 				else
| 951| 951| 					break;
| 952|    |-			}
|    | 952|+			
| 953| 953| 			consec[i] = count;
| 954| 954| 		}
| 955| 955| 		var start = 0;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 955| 955| 		var start = 0;
| 956| 956| 		var count = 0;
| 957| 957| 		for (var c in consec)
| 958|    |-		{
|    | 958|+		
| 959| 959| 			if (consec[c] > count)
| 960| 960| 			{
| 961| 961| 				start = c;
| 962| 962| 				count = consec[c];
| 963| 963| 			}
| 964|    |-		}
|    | 964|+		
| 965| 965| 
| 966| 966| 		// If we've found a shoreline, stop searching
| 967| 967| 		if (count != numPoints-1)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'metadata'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1138|1138| 
|1139|1139| 	// send Metadata info if any
|1140|1140| 	if (cmd.metadata)
|1141|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1141|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1142|1142| 
|1143|1143| 	// Tell the units to start building this new entity
|1144|1144| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'owner'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1138|1138| 
|1139|1139| 	// send Metadata info if any
|1140|1140| 	if (cmd.metadata)
|1141|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1141|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1142|1142| 
|1143|1143| 	// Tell the units to start building this new entity
|1144|1144| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1138|1138| 
|1139|1139| 	// send Metadata info if any
|1140|1140| 	if (cmd.metadata)
|1141|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1141|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1142|1142| 
|1143|1143| 	// Tell the units to start building this new entity
|1144|1144| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1142|1142| 
|1143|1143| 	// Tell the units to start building this new entity
|1144|1144| 	if (cmd.autorepair)
|1145|    |-	{
|    |1145|+	
|1146|1146| 		ProcessCommand(player, {
|1147|1147| 			"type": "repair",
|1148|1148| 			"entities": entities,
|1150|1150| 			"autocontinue": cmd.autocontinue,
|1151|1151| 			"queued": cmd.queued
|1152|1152| 		});
|1153|    |-	}
|    |1153|+	
|1154|1154| 
|1155|1155| 	return ent;
|1156|1156| }
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1246|1246| 		}
|1247|1247| 
|1248|1248| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1249|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1249|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1250|1250| 	}
|1251|1251| 
|1252|1252| 	var i = 0;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1263|1263| 		// 'lastTowerControlGroup' must always be defined and valid here, except if we're at the first piece and we didn't do
|1264|1264| 		// start position snapping (implying that the first entity we build must be a tower)
|1265|1265| 		if (lastTowerControlGroup === null || lastTowerControlGroup == INVALID_ENTITY)
|1266|    |-		{
|    |1266|+		
|1267|1267| 			if (!(i == 0 && piece.template == cmd.wallSet.templates.tower && !cmd.startSnappedEntity))
|1268|1268| 			{
|1269|1269|     			error("[TryConstructWall] Expected last tower control group to be available, none found (1st pass, iteration " + i + ")");
|1270|1270|     			break;
|1271|1271| 			}
|1272|    |-		}
|    |1272|+		
|1273|1273| 
|1274|1274| 		var constructPieceCmd = {
|1275|1275| 			"type": "construct",
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1310|1310| 
|1311|1311| 				if (i > 0)
|1312|1312| 				{
|1313|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1313|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1314|1314| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1315|1315| 					// TODO: ensure that cmpPreviousObstruction exists
|1316|1316| 					// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1368|1368| 		}
|1369|1369| 
|1370|1370| 		if (piece.template == cmd.wallSet.templates.tower)
|1371|    |-		{
|    |1371|+		
|1372|1372| 			// encountered a tower entity, update the last tower control group
|1373|1373| 			lastTowerControlGroup = cmpPieceObstruction.GetControlGroup();
|1374|    |-		}
|    |1374|+		
|1375|1375| 		else
|1376|1376| 		{
|1377|1377| 			// Encountered a non-tower entity, update its secondary control group to 'lastTowerControlGroup'.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1382|1382| 			if (existingSecondaryControlGroup == INVALID_ENTITY)
|1383|1383| 			{
|1384|1384| 				if (lastTowerControlGroup != null && lastTowerControlGroup != INVALID_ENTITY)
|1385|    |-				{
|    |1385|+				
|1386|1386| 					cmpPieceObstruction.SetControlGroup2(lastTowerControlGroup);
|1387|    |-				}
|    |1387|+				
|1388|1388| 			}
|1389|1389| 			else if (existingSecondaryControlGroup != lastTowerControlGroup)
|1390|1390| 			{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1457|1457| 	}
|1458|1458| 
|1459|1459| 	if (formedEnts.length == 0)
|1460|    |-	{
|    |1460|+	
|1461|1461| 		// No units support the formation - return all the others
|1462|1462| 		return nonformedUnitAIs;
|1463|    |-	}
|    |1463|+	
|1464|1464| 
|1465|1465| 	// Find what formations the formationable selected entities are currently in
|1466|1466| 	var formation = ExtractFormations(formedEnts);
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1473|1473| 		// Check that all its members are selected
|1474|1474| 		var fid = formationIds[0];
|1475|1475| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1476|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1477|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1476|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1477|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1478|1478| 		{
|1479|1479| 			cmpFormation.DeleteTwinFormations();
|1480|1480| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1505|1505| 					{
|1506|1506| 						var template = cmpUnitAI.GetFormationTemplate();
|1507|1507| 						if (lastFormationTemplate === undefined)
|1508|    |-						{
|    |1508|+						
|1509|1509| 							lastFormationTemplate = template;
|1510|    |-						}
|    |1510|+						
|1511|1511| 						else if (lastFormationTemplate != template)
|1512|1512| 						{
|1513|1513| 							lastFormationTemplate = undefined;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1581|1581| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1582|1582| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1583|1583| 				if (matrix[i][j] < distSq)
|1584|    |-					closeClusters = [i,j];
|    |1584|+					closeClusters = [i, j];
|1585|1585| 
|1586|1586| 		// if no more close clusters found, just return all found clusters so far
|1587|1587| 		if (!closeClusters)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1603|1603| 		}
|1604|1604| 		// remove the rows and columns in the matrix for the merged clusters,
|1605|1605| 		// and the clusters themselves from the cluster list
|1606|    |-		clusters.splice(closeClusters[0],1);
|    |1606|+		clusters.splice(closeClusters[0], 1);
|1607|1607| 		clusters.splice(closeClusters[1],1);
|1608|1608| 		matrix.splice(closeClusters[0],1);
|1609|1609| 		matrix.splice(closeClusters[1],1);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1604|1604| 		// remove the rows and columns in the matrix for the merged clusters,
|1605|1605| 		// and the clusters themselves from the cluster list
|1606|1606| 		clusters.splice(closeClusters[0],1);
|1607|    |-		clusters.splice(closeClusters[1],1);
|    |1607|+		clusters.splice(closeClusters[1], 1);
|1608|1608| 		matrix.splice(closeClusters[0],1);
|1609|1609| 		matrix.splice(closeClusters[1],1);
|1610|1610| 		for (let i = 0; i < matrix.length; ++i)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1605|1605| 		// and the clusters themselves from the cluster list
|1606|1606| 		clusters.splice(closeClusters[0],1);
|1607|1607| 		clusters.splice(closeClusters[1],1);
|1608|    |-		matrix.splice(closeClusters[0],1);
|    |1608|+		matrix.splice(closeClusters[0], 1);
|1609|1609| 		matrix.splice(closeClusters[1],1);
|1610|1610| 		for (let i = 0; i < matrix.length; ++i)
|1611|1611| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1606|1606| 		clusters.splice(closeClusters[0],1);
|1607|1607| 		clusters.splice(closeClusters[1],1);
|1608|1608| 		matrix.splice(closeClusters[0],1);
|1609|    |-		matrix.splice(closeClusters[1],1);
|    |1609|+		matrix.splice(closeClusters[1], 1);
|1610|1610| 		for (let i = 0; i < matrix.length; ++i)
|1611|1611| 		{
|1612|1612| 			if (matrix[i].length > closeClusters[0])
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1610|1610| 		for (let i = 0; i < matrix.length; ++i)
|1611|1611| 		{
|1612|1612| 			if (matrix[i].length > closeClusters[0])
|1613|    |-				matrix[i].splice(closeClusters[0],1);
|    |1613|+				matrix[i].splice(closeClusters[0], 1);
|1614|1614| 			if (matrix[i].length > closeClusters[1])
|1615|1615| 				matrix[i].splice(closeClusters[1],1);
|1616|1616| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1612|1612| 			if (matrix[i].length > closeClusters[0])
|1613|1613| 				matrix[i].splice(closeClusters[0],1);
|1614|1614| 			if (matrix[i].length > closeClusters[1])
|1615|    |-				matrix[i].splice(closeClusters[1],1);
|    |1615|+				matrix[i].splice(closeClusters[1], 1);
|1616|1616| 		}
|1617|1617| 		// add a new row of distances to the matrix and the new cluster
|1618|1618| 		clusters.push(newCluster);

binaries/data/mods/public/simulation/helpers/Commands.js
|  43| »   if·(g_Commands[cmd.type])
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|  47| »   »   g_Commands[cmd.type](player,·cmd,·data);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 784| »   »   let·ent·=·pickRandom(cmpRangeManager.GetEntitiesByPlayer(cmd.player).filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1269| ····»   »   »   error("[TryConstructWall]·Expected·last·tower·control·group·to·be·available,·none·found·(1st·pass,·iteration·"·+·i·+·")");
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1270| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1500| »   »   »   »   var·lastFormationTemplate·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastFormationTemplate' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1579| »   »   var·closeClusters·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1596| »   »   for·(let·i·=·0;·i·<·clusters.length;·++i)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1610| »   »   for·(let·i·=·0;·i·<·matrix.length;·++i)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 536| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 724| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 943| »   »   for·(var·i·=·0;·i·<·length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 956| »   »   var·count·=·0;
|    | [NORMAL] JSHintBear:
|    | 'count' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1103| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGuiInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1355| »   »   var·piece·=·pieces[j];
|    | [NORMAL] JSHintBear:
|    | 'piece' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1438| »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1477| »   »   »   &&·cmpFormation.GetMemberCount()·==·formation.entities.length)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
|1503| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1536| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.
Executing section cli...

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

Related work:

  • rP22436 wrapped damage types in a `Damage sub-element in Attacks.
  • D1938 makes the game damage-type agnostic entirely
  • D2044 adds immunity, and thus also adds unitAI logic to upgrade "CanAttack"
  • D1965 adds instant-kill (may not be desirable)
  • D2016 moves ElevationBonus and Delay to projectile.

Sub-elements I can identify here:

  • Conceptually, ranged and melee attacks become similar except one deals 'instantaneous' damage and the other deals 'projectile' damage. Here the presence of a Projectile node differentiate. I would argue that we should put Damage node in the projectile for such attacks, and thus 'Melee' would probably get an 'Instantaneous>Damage' nodes as equivalents. This would prepare for continuous damage, aka beams.
  • Allowing attacks to deal both "Damage" or "Capture". I guess this is "AND" here, so first question: should it be xor instead? I guess dealing both damage and capturing is a bit weird, and it sounds like it would trigger annoying edge cases (such as a player wants capturing, we have an attack that captures but slower than it would destroy, the entity gets destroyed instead of captured)
    • further, making "Capture" a damage type means handling it in armour, and it conflicts with D1938. We already have Capturable, so I think it would be much better to allow any attack to have a "Capture" effect, but not treat it as a damage type.
  • UnitAI needs a way to know if it can attack/capture an enemy (related to D2044, immunity, and infinite armour)
  • UnitAI needs a way to find the best attack/capture attack against an enemy. This is rather easy with equal range using DPS. With unequal range, this becomes much trickier. Here we have "preferred attacks".
    • My suggestion would be to implement simple "personalities" in UnitAI, and the units would weight range based on that. e.g. 'artillery' personality would almost always prefer long-range, only fighting short-range if necessary. Would also make it doable GUI-wise.
  • the GUI needs a way to show these different attack types

Possible further work:

  • allowing a player to always pick some attack.
  • allowing multiple projectiles per attack.
  • implement beams.

The tooltip thing should indeed be moved, so that this diffs changes fewer files.

binaries/data/mods/public/simulation/components/Attack.js
636

"immediately after" sounds a bit like an oxymoron. See discussion on D2016, I think rather this should be handled by a status effect.

I like the concept of the patch, overall it's not that big of a chance which is also nice :)

I don't like treating 'capture' as a damage type. It's 'capture', not damage, and should simply be a separate node in Attack.js, and not handled in Armour.js but in Capturable.js . However that should probably be dealt with in Damage.JS, so perhaps rename that AttackEffect.js or something.
Relatedly, I'm not a fan of allowing both damage _and_ capture in one attack type, it sounds easier to be XOR for now.

I would move the Damage node to the projectile, and also authorise an "Instantaneous" node as a choice with "Projectile" for melee.

The way you've handled this in UnitAI seems sub-optimal, but finding a good solution is difficult here. I guess it might be moved to a later patch and hardcode "melee" vs "ranged" for now.

bb added a comment.Jul 16 2019, 3:21 PM
In D368#86809, @wraitii wrote:
  • Conceptually, ranged and melee attacks become similar except one deals 'instantaneous' damage and the other deals 'projectile' damage. Here the presence of a Projectile node differentiate. I would argue that we should put Damage node in the projectile for such attacks, and thus 'Melee' would probably get an 'Instantaneous>Damage' nodes as equivalents. This would prepare for continuous damage, aka beams.

Can indeed be a nice idea, that way an attackType could in principle have both an instantaneous and a projectile damage (this example sounds weird though, but beam+projectile goes with the same idea, which is more plausible). However implementing this properly sounds like allowing multiple projectiles, which will need a ton of designing work, so would say "out of scope".

  • Allowing attacks to deal both "Damage" or "Capture". I guess this is "AND" here, so first question: should it be xor instead? I guess dealing both damage and capturing is a bit weird, and it sounds like it would trigger annoying edge cases (such as a player wants capturing, we have an attack that captures but slower than it would destroy, the entity gets destroyed instead of captured)

Why would we limit a component to xor instead of leaving it to the template and by that giving full moddability? Yes it might give edgy cases when choosing attackTypes, but with the current implementation we (IMO) return something reasonable, which is IMO enough for the moddability support. In vanilla we could simply avoid this case by not having such a template, if we think it is too broken. Other than that I don't see much problems in allowing the "AND".

  • further, making "Capture" a damage type means handling it in armour, and it conflicts with D1938.

It indeed means handling through Armour, as is done in the patch (one is now also allowed to have a "Capture" armour, seems nice for moddability too). I didn't see a direct conflict though

We already have Capturable, so I think it would be much better to allow any attack to have a "Capture" effect, but not treat it as a damage type.

But Capturable isn't the equivalent of Armour, Capturable is the equivalent of Health. Armour will call the correct component based on the damageType. I here generalized the damageTypes to define a component they deal the damage on ie. Capturable or Health. Maybe we can do something about the "Damage" naming though.

  • UnitAI needs a way to know if it can attack/capture an enemy (related to D2044, immunity, and infinite armour)

See Attack.CanAttack and the function called there

  • UnitAI needs a way to find the best attack/capture attack against an enemy. This is rather easy with equal range using DPS. With unequal range, this becomes much trickier. Here we have "preferred attacks".

See Attack.GetBestAttackAgainst where we do a DPS range.

  • My suggestion would be to implement simple "personalities" in UnitAI, and the units would weight range based on that. e.g. 'artillery' personality would almost always prefer long-range, only fighting short-range if necessary. Would also make it doable GUI-wise.

What one could do (which has pretty much this effect) is setting the base of the power used in GetBestAttackAgainst (the 0.2 now in L420 and L422) in the template. The higher the base the more it will favor short ranged attacks.

  • the GUI needs a way to show these different attack types

For now they are just added in the tooltip

Possible further work:

  • allowing a player to always pick some attack.

Currently hotkeys are implemented to do this to some extend, but more/better ideas are welcome

  • allowing multiple projectiles per attack.
  • implement beams.

needs designing

binaries/data/mods/public/simulation/components/Attack.js
417

Also Spread

bb edited the summary of this revision. (Show Details)Jul 16 2019, 3:25 PM
wraitii added a comment.EditedJul 16 2019, 3:39 PM
In D368#86822, @bb wrote:

Can indeed be a nice idea, that way an attackType could in principle have both an instantaneous and a projectile damage (this example sounds weird though, but beam+projectile goes with the same idea, which is more plausible). However implementing this properly sounds like allowing multiple projectiles, which will need a ton of designing work, so would say "out of scope".

I'm not sure why you think this would take a ton of designing work? it seems rather easy to me once we get the above.

But Capturable isn't the equivalent of Armour, Capturable is the equivalent of Health. Armour will call the correct component based on the damageType.

Thinking some more: is that actually good design, though? Armour does nothing unless Health exists, so shouldn't armour just be a sub-element of health?

I think it might not be extremely clear, but you change so that it now reads

<Attack>
  <Melee>
    <Damage>
      <Hack>45</Hack>
      <Capture>25</Capture>
    </Damage>
  </Melee>
</Attack>

I suggest changing it so that it reads:
I think it might not be extremely clear, but you change so that it now reads

<Attack>
  <Melee>
    <Damage>
      <Hack>45</Hack>
    </Damage>
    <Capture>25</Capture>
  </Melee>
</Attack>

which still keeps all the above possibilities, but makes it so that capture isn't a damage type, because well, it isn't.

Edit: it might be worth putting the results of this discussion in the design document BTW.

bb added a comment.Jul 16 2019, 4:38 PM
In D368#86829, @wraitii wrote:
In D368#86822, @bb wrote:

Can indeed be a nice idea, that way an attackType could in principle have both an instantaneous and a projectile damage (this example sounds weird though, but beam+projectile goes with the same idea, which is more plausible). However implementing this properly sounds like allowing multiple projectiles, which will need a ton of designing work, so would say "out of scope".

I'm not sure why you think this would take a ton of designing work? it seems rather easy to me once we get the above.

One should design what values a projectile can set, its not only Damage, Range is to me even a more prominent candidate, also how do deal with this animation wise, sound wise?

But Capturable isn't the equivalent of Armour, Capturable is the equivalent of Health. Armour will call the correct component based on the damageType.

Thinking some more: is that actually good design, though? Armour does nothing unless Health exists, so shouldn't armour just be a sub-element of health?

The current design is: Attack calls Damage and Capturable, Damage calls Armour, Armour calls Health. Where Attack is from the attacker entity, Damage a system component and Amour, Capturable and Health are defender components.
This patch makes the design: Attack calls Damage, Damage calls Armour, Armour calls Health and Capturable.
You propose (I guess): Attack calls Damage, Damage calls Armour and Capturable, Armour calls Health

So in the current and your proposal Health and Amour could/should be merged. However in this patch Armour gets a more crucial role in distributing the damageTypes to the correct component.
I think the best way to look at it is: how should be implement another type of health/Capture? So someone wants a "stun" component, so one can attack a unit, till it is stunned, and then the attacked unit will revive after a certain time. Would we then want to add this case too to Damage.js and everywhere we want to display it in the GUI? Or rather softcode it in a DamageType which directly gets the handling it needs (via Armour) and also gets passed to the GUI where it will be displayed?
(Obviously one should consider if this patch is actually making it that easy, e.g. the Health dependence in capture isn't the nicest of all, but we can make that a bit nicer too)

which still keeps all the above possibilities, but makes it so that capture isn't a damage type, because well, it isn't.

That is a naming argument, I am happy to change "Damage" into whatever is more appropriate

bb added inline comments.Jul 16 2019, 5:35 PM
binaries/data/mods/public/simulation/components/Damage.js
258

statuseffect missing

One should design what values a projectile can set, its not only Damage, Range is to me even a more prominent candidate, also how do deal with this animation wise, sound wise?

Well that work is ingoing somewhat, see the debate about elevation bonus. But yes, fair point.

The current design is: Attack calls Damage and Capturable, Damage calls Armour, Armour calls Health. Where Attack is from the attacker entity, Damage a system component and Amour, Capturable and Health are defender components.
This patch makes the design: Attack calls Damage, Damage calls Armour, Armour calls Health and Capturable.

And my suggestion is to make it "Attack calls [Damage], Damage calls Health + Capturable".
However we could easily keep a generic system with my XML suggestion above if we introduce a new "Capture" component that acts similarly to Armour, and just passes the data to Capture. I'm not sure it's much better tbh.

I think the best way to look at it is: how should be implement another type of health/Capture? So someone wants a "stun" component, so one can attack a unit, till it is stunned, and then the attacked unit will revive after a certain time. Would we then want to add this case too to Damage.js and everywhere we want to display it in the GUI?

Mh... I guess we would need to add new status bars, new GUI elements, things like that, and it doesn't sound like adding a few lines of special handling is so bad, to me. I'll think about it some more.

That is a naming argument, I am happy to change "Damage" into whatever is more appropriate

It's not just a naming argument. With D1938, any string can be a damage type. However, if "capture" becomes special, then it means we need special handling of it everywhere, including in the AI. That sounds like it completely breaks the point of D1938 and sounds like a serious pessimisation to me.

I agree with @wraitii that using capture as a damage type is weird ;) But also agree that a modder should have the option to do both damage and capture at the same time.
The armour for capture is interesting, but isn't there the CP-regenrate for already?
Wouldn't beams be just ranged attack with a stream of projectiles? Or am I thinking to limited now.

I think we should watch out with giving GetBestAttackAgainst too much power, though I reckon that it is hard to easily let the player be in charge of the attack type when they are arbitrary named.
Maybe a list of icons (like the current stances): Preferred attack type:

  • Automatic (let GetBestAttackAgainst decide; default)
  • Ranged (whenever possible, use this; automatically engage even if this type cannot be used?)
  • Type 2
  • Etc.

Letting the player choose a specific order seems to much micro to me, I don't really know yet about the micro of this option and what to show when multiple types of soldiers are selected.
Alt-hotkey can be used to switch between capture and normal attack.

I will upload a diff making Capture less special (following my above proposition) to have some comparison point, I think this needs to be handled separately and before this can get committed.

See D2081 for how I would handle capture and status effects as a preliminary to this diff.

@bb: I've committed rP22754, making "Damage" and "Capture" not based on the attack names, allowing you to drop that from this diff.
I think you'll find my final decision OK with regards to how templates get written.
If not, feel free to discuss this by PM or on a forum thread or through the audit feature or something.