diff --git a/binaries/data/mods/public/gamesettings/attributes/PlayerColor.js b/binaries/data/mods/public/gamesettings/attributes/PlayerColor.js index 0e9c19c115..62bd857427 100644 --- a/binaries/data/mods/public/gamesettings/attributes/PlayerColor.js +++ b/binaries/data/mods/public/gamesettings/attributes/PlayerColor.js @@ -192,7 +192,7 @@ GameSettings.prototype.Attributes.PlayerColor = class PlayerColor extends GameSe GameSettings.prototype.Attributes.PlayerColor.prototype.DefaultColors = [ { "r": 10, "g": 10, "b": 190 }, { "r": 230, "g": 10, "b": 10 }, - { "r": 125 , "g": 235, "b": 15 }, + { "r": 125, "g": 235, "b": 15 }, { "r": 255, "g": 255, "b": 55 }, { "r": 130, "g": 0, "b": 230 }, { "r": 255, "g": 130, "b": 0 }, diff --git a/binaries/data/mods/public/globalscripts/Math.js b/binaries/data/mods/public/globalscripts/Math.js index 2e238b6c7e..d3ae43f66a 100644 --- a/binaries/data/mods/public/globalscripts/Math.js +++ b/binaries/data/mods/public/globalscripts/Math.js @@ -90,7 +90,7 @@ Math.atan = function(a) /** * Approximation of arctangent of y/x, returns angle from -pi to pi */ -Math.atan2 = function(y,x) +Math.atan2 = function(y, x) { // get unsigned x,y for ease of calculation, this means all angles are in the range [0, pi/2] var ux = Math.abs(x); diff --git a/binaries/data/mods/public/maps/random/coast_range.js b/binaries/data/mods/public/maps/random/coast_range.js index 80ba32b679..9f72300ad7 100644 --- a/binaries/data/mods/public/maps/random/coast_range.js +++ b/binaries/data/mods/public/maps/random/coast_range.js @@ -161,11 +161,11 @@ function* GenerateMap(mapSettings) { 0, [Math.floor(fractionToTiles(0.01))]), [ - new LayeredPainter([tHill,tMainTerrain], [Math.floor(elevRand / 3), 40]), + new LayeredPainter([tHill, tMainTerrain], [Math.floor(elevRand / 3), 40]), new SmoothElevationPainter(ELEVATION_SET, elevRand, Math.floor(elevRand / 3)), new TileClassPainter(clHill) ], - [avoidClasses(clPlayer, 16),stayClasses(clLand, 28)]); + [avoidClasses(clPlayer, 16), stayClasses(clLand, 28)]); } const nonMountainPosition = Vector2D.add(mapCenter, new Vector2D(0, fractionToTiles(0.10)).rotate(startAngle).rotate(Math.PI)).round(); @@ -192,7 +192,7 @@ function* GenerateMap(mapSettings) { new SmoothElevationPainter(ELEVATION_SET, elevRand, randIntInclusive(18, 30)), new TileClassPainter(clMountain) ], - [avoidClasses(clNotMountain,2, clMountain, 3)]); + [avoidClasses(clNotMountain, 2, clMountain, 3)]); } for (let m = 0; m < randIntInclusive(100, 180); ++m) { const elevRand = randIntInclusive(24, 38); @@ -218,7 +218,7 @@ function* GenerateMap(mapSettings) { const [forestTrees, stragglerTrees] = getTreeCounts(...rBiomeTreeCount(1)); createDefaultForests( [tMainTerrain, tForestFloor1, tForestFloor2, pForest1, pForest2], - [avoidClasses(clPlayer, 20, clForest, 17, clMountain, 8, clBaseResource,2), stayClasses(clLand, 4)], + [avoidClasses(clPlayer, 20, clForest, 17, clMountain, 8, clBaseResource, 2), stayClasses(clLand, 4)], clForest, forestTrees); @@ -227,8 +227,8 @@ function* GenerateMap(mapSettings) { g_Map.log("Creating dirt patches"); createLayeredPatches( [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)], - [[tMainTerrain,tTier1Terrain],[tTier1Terrain,tTier2Terrain], [tTier2Terrain,tTier3Terrain]], - [1,1], + [[tMainTerrain, tTier1Terrain], [tTier1Terrain, tTier2Terrain], [tTier2Terrain, tTier3Terrain]], + [1, 1], [avoidClasses(clForest, 0, clDirt, 5, clPlayer, 12), stayClasses(clLand, 5)], scaleByMapSize(15, 45), clDirt); diff --git a/binaries/data/mods/public/maps/random/foothills.js b/binaries/data/mods/public/maps/random/foothills.js index 3c080bbcfa..162d813a3b 100644 --- a/binaries/data/mods/public/maps/random/foothills.js +++ b/binaries/data/mods/public/maps/random/foothills.js @@ -138,7 +138,7 @@ function* GenerateMap(mapSettings) 0, [Math.floor(fractionToTiles(0.01))]), [ - new LayeredPainter([tCliff, tHill,tMainTerrain], [Math.floor(elevRand / 8), 40]), + new LayeredPainter([tCliff, tHill, tMainTerrain], [Math.floor(elevRand / 8), 40]), new SmoothElevationPainter(ELEVATION_SET, elevRand, randIntInclusive(18, 25)), new TileClassPainter(clHill) ], diff --git a/binaries/data/mods/public/maps/random/rmgen/placer/centered/ChainPlacer.js b/binaries/data/mods/public/maps/random/rmgen/placer/centered/ChainPlacer.js index a23c3c514a..d73bc81f0d 100644 --- a/binaries/data/mods/public/maps/random/rmgen/placer/centered/ChainPlacer.js +++ b/binaries/data/mods/public/maps/random/rmgen/placer/centered/ChainPlacer.js @@ -95,7 +95,7 @@ ChainPlacer.prototype.place = function(constraint) Math.abs(this.centerPosition.y - pos.y) > this.maxDistance)) continue; - if (gotRet[at(pos.x,pos.y)] != 1) + if (gotRet[at(pos.x, pos.y)] != 1) continue; if (pos.x > 0 && gotRet[at(pos.x - 1, pos.y)] == 0 || diff --git a/binaries/data/mods/public/maps/random/rmgen/placer/centered/ClumpPlacer.js b/binaries/data/mods/public/maps/random/rmgen/placer/centered/ClumpPlacer.js index c379c55c48..411b2b7d64 100644 --- a/binaries/data/mods/public/maps/random/rmgen/placer/centered/ClumpPlacer.js +++ b/binaries/data/mods/public/maps/random/rmgen/placer/centered/ClumpPlacer.js @@ -38,7 +38,7 @@ ClumpPlacer.prototype.place = function(constraint) let perim = 4 * radius * 2 * Math.PI; let intPerim = Math.ceil(perim); - let ctrlPts = 1 + Math.floor(1.0/Math.max(this.smoothness,1.0/intPerim)); + let ctrlPts = 1 + Math.floor(1.0/Math.max(this.smoothness, 1.0/intPerim)); if (ctrlPts > radius * 2 * Math.PI) ctrlPts = Math.floor(radius * 2 * Math.PI) + 1; diff --git a/binaries/data/mods/public/maps/scenarios/treasure_islands.js b/binaries/data/mods/public/maps/scenarios/treasure_islands.js index 28e073d518..af5a589fcf 100644 --- a/binaries/data/mods/public/maps/scenarios/treasure_islands.js +++ b/binaries/data/mods/public/maps/scenarios/treasure_islands.js @@ -5,7 +5,7 @@ Trigger.prototype.IntroductionMessage = function(data) var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); cmpGUIInterface.PushNotification({ - "players": [1,2], + "players": [1, 2], "message": markForTranslation("Collect the treasures before your enemy does! May the better win!"), "translateMessage": true }); @@ -24,7 +24,7 @@ Trigger.prototype.TreasureCollected = function(data) (this.treasureCount.players[otherPlayer] == this.treasureCount.maximum / 2) ) { cmpGUIInterface.PushNotification({ - "players": [1,2], + "players": [1, 2], "message": markForTranslation("No winner yet, prepare for battle!"), "translateMessage": true }); @@ -87,7 +87,7 @@ Trigger.prototype.BattleMessage = function() { var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); cmpGUIInterface.PushNotification({ - "players": [1,2], + "players": [1, 2], "message": markForTranslation("Defeat your enemy to win!"), "translateMessage": true }); @@ -110,7 +110,7 @@ Trigger.prototype.Victory = function(playerID) var cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); // TODO: It would be nice to get the total number of treasure on the map automatically somehow -cmpTrigger.treasureCount = { "players": { "1":0,"2":0 }, "maximum": 36 }; +cmpTrigger.treasureCount = { "players": { "1":0, "2":0 }, "maximum": 36 }; cmpTrigger.state = "start"; cmpTrigger.DoAfterDelay(2000, "IntroductionMessage", {}); cmpTrigger.RegisterTrigger("OnTreasureCollected", "TreasureCollected", { "enabled": true }); diff --git a/binaries/data/mods/public/maps/scenarios/triggers_demo.js b/binaries/data/mods/public/maps/scenarios/triggers_demo.js index d346309181..d80cd9243e 100644 --- a/binaries/data/mods/public/maps/scenarios/triggers_demo.js +++ b/binaries/data/mods/public/maps/scenarios/triggers_demo.js @@ -71,7 +71,7 @@ Trigger.prototype.IntervalAction = function(data) var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); cmpGUIInterface.PushNotification({ "type": "dialog", - "players": [1,2,3,4,5,6,7,8], + "players": [1, 2, 3, 4, 5, 6, 7, 8], "dialogName": "yes-no", "data": { "text": { diff --git a/binaries/data/mods/public/simulation/components/BuildingAI.js b/binaries/data/mods/public/simulation/components/BuildingAI.js index fcab3db1dc..d285c6557d 100644 --- a/binaries/data/mods/public/simulation/components/BuildingAI.js +++ b/binaries/data/mods/public/simulation/components/BuildingAI.js @@ -347,7 +347,7 @@ BuildingAI.prototype.FireArrows = function() for (let target of this.targetUnits) addTarget(target); // Sort targets by preference and then by proximity. - targets.sort( (a,b) => { + targets.sort( (a, b) => { if (a.preference > b.preference) return 1; else if (a.preference < b.preference) diff --git a/binaries/data/mods/public/simulation/helpers/Commands.js b/binaries/data/mods/public/simulation/helpers/Commands.js index f406bb3b5f..0d1fee2d3f 100644 --- a/binaries/data/mods/public/simulation/helpers/Commands.js +++ b/binaries/data/mods/public/simulation/helpers/Commands.js @@ -1670,7 +1670,7 @@ function ClusterEntities(ents, separationDistance) for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i) for (let j = i - 1; j >= 0 && !closeClusters; --j) if (matrix[i][j] < distSq) - closeClusters = [i,j]; + closeClusters = [i, j]; // if no more close clusters found, just return all found clusters so far if (!closeClusters) @@ -1694,16 +1694,16 @@ function ClusterEntities(ents, separationDistance) } // remove the rows and columns in the matrix for the merged clusters, // and the clusters themselves from the cluster list - clusters.splice(closeClusters[0],1); - clusters.splice(closeClusters[1],1); - matrix.splice(closeClusters[0],1); - matrix.splice(closeClusters[1],1); + clusters.splice(closeClusters[0], 1); + clusters.splice(closeClusters[1], 1); + matrix.splice(closeClusters[0], 1); + matrix.splice(closeClusters[1], 1); for (let i = 0; i < matrix.length; ++i) { if (matrix[i].length > closeClusters[0]) - matrix[i].splice(closeClusters[0],1); + matrix[i].splice(closeClusters[0], 1); if (matrix[i].length > closeClusters[1]) - matrix[i].splice(closeClusters[1],1); + matrix[i].splice(closeClusters[1], 1); } // add a new row of distances to the matrix and the new cluster clusters.push(newCluster);