Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/african_plains.js
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||||||
var clForest = g_Map.createTileClass(); | var clForest = g_Map.createTileClass(); | ||||||||
var clWater = g_Map.createTileClass(); | var clWater = g_Map.createTileClass(); | ||||||||
var clDirt = g_Map.createTileClass(); | var clDirt = g_Map.createTileClass(); | ||||||||
var clRock = g_Map.createTileClass(); | var clRock = g_Map.createTileClass(); | ||||||||
var clMetal = g_Map.createTileClass(); | var clMetal = g_Map.createTileClass(); | ||||||||
var clFood = g_Map.createTileClass(); | var clFood = g_Map.createTileClass(); | ||||||||
var clBaseResource = g_Map.createTileClass(); | var clBaseResource = g_Map.createTileClass(); | ||||||||
if (g_MapSettings.EvenPlayerSpacing) { | |||||||||
placePlayerBases({ | placePlayerBases({ | ||||||||
lyv: Implicit unpredictable paths should be avoided. Warn and use default circle instead. | |||||||||
"PlayerPlacement": playerPlacementCircle(fractionToTiles(0.35)), | "PlayerPlacement": playerPlacementCircle(fractionToTiles(0.35)), | ||||||||
Not Done Inline ActionsI guess you only need to have the if here? Freagarach: I guess you only need to have the if here?
(Less duplication is (often) better.) | |||||||||
Not Done Inline Actions
I don't know what you mean. Are you asking a question or confirming something, or suggesting something? I don't know where else to put the if, as as I'm used to C function calls, I don't know if it's possible with javascript to put an if statement within parentheses. andy5995: > I guess you only need to have the if here?
I don't know what you mean. Are you asking a… | |||||||||
FreagarachUnsubmitted Not Done Inline Actions
In kind of pseudocode. Freagarach: In kind of pseudocode. | |||||||||
"PlayerTileClass": clPlayer, | "PlayerTileClass": clPlayer, | ||||||||
"BaseResourceClass": clBaseResource, | "BaseResourceClass": clBaseResource, | ||||||||
"CityPatch": { | "CityPatch": { | ||||||||
"outerTerrain": tPrimary, | "outerTerrain": tPrimary, | ||||||||
"innerTerrain": tCitytiles | "innerTerrain": tCitytiles | ||||||||
}, | }, | ||||||||
"Chicken": { | "Chicken": { | ||||||||
}, | }, | ||||||||
"Berries": { | "Berries": { | ||||||||
"template": oBerryBush | "template": oBerryBush | ||||||||
}, | }, | ||||||||
"Mines": { | "Mines": { | ||||||||
"types": [ | "types": [ | ||||||||
{ | { | ||||||||
"template": oMetalLarge | "template": oMetalLarge | ||||||||
}, | }, | ||||||||
{ | { | ||||||||
"type": "stone_formation", | "type": "stone_formation", | ||||||||
"template": oStoneSmall, | "template": oStoneSmall, | ||||||||
"terrain": tDirt4 | "terrain": tDirt4 | ||||||||
} | } | ||||||||
] | ] | ||||||||
}, | }, | ||||||||
"Trees": { | "Trees": { | ||||||||
"template": oBaobab, | "template": oBaobab, | ||||||||
"count": scaleByMapSize(3, 12), | "count": scaleByMapSize(3, 12), | ||||||||
"minDistGroup": 2, | "minDistGroup": 2, | ||||||||
"maxDistGroup": 6, | "maxDistGroup": 6, | ||||||||
"minDist": 15, | "minDist": 15, | ||||||||
"maxDist": 16 | "maxDist": 16 | ||||||||
} | } | ||||||||
// No decoratives | // No decoratives | ||||||||
}); | }); | ||||||||
} | |||||||||
else { | |||||||||
placePlayerBases({ | |||||||||
"PlayerPlacement": [sortAllPlayers(), ...playerPlacementMultiArcs(fractionToTiles(0.35), 0, 0.75)], | |||||||||
Not Done Inline ActionsThis can be done in the function? Freagarach: This can be done in the function? | |||||||||
"PlayerTileClass": clPlayer, | |||||||||
"BaseResourceClass": clBaseResource, | |||||||||
"CityPatch": { | |||||||||
"outerTerrain": tPrimary, | |||||||||
"innerTerrain": tCitytiles | |||||||||
}, | |||||||||
"Chicken": { | |||||||||
}, | |||||||||
"Berries": { | |||||||||
"template": oBerryBush | |||||||||
}, | |||||||||
"Mines": { | |||||||||
"types": [ | |||||||||
{ | |||||||||
"template": oMetalLarge | |||||||||
}, | |||||||||
{ | |||||||||
"type": "stone_formation", | |||||||||
"template": oStoneSmall, | |||||||||
"terrain": tDirt4 | |||||||||
} | |||||||||
] | |||||||||
}, | |||||||||
"Trees": { | |||||||||
"template": oBaobab, | |||||||||
"count": scaleByMapSize(3, 12), | |||||||||
"minDistGroup": 2, | |||||||||
"maxDistGroup": 6, | |||||||||
"minDist": 15, | |||||||||
"maxDist": 16 | |||||||||
} | |||||||||
// No decoratives | |||||||||
}); | |||||||||
} | |||||||||
Engine.SetProgress(20); | Engine.SetProgress(20); | ||||||||
// The specificity of this map is a bunch of watering holes & hills making it somewhat cluttered. | // The specificity of this map is a bunch of watering holes & hills making it somewhat cluttered. | ||||||||
const nbHills = scaleByMapSize(6, 16); | const nbHills = scaleByMapSize(6, 16); | ||||||||
const nbWateringHoles = scaleByMapSize(4, 10); | const nbWateringHoles = scaleByMapSize(4, 10); | ||||||||
{ | { | ||||||||
g_Map.log("Creating hills"); | g_Map.log("Creating hills"); | ||||||||
createHills([tDirt2, tCliff, tGrassShrubs], avoidClasses(clPlayer, 30, clHill, 15), clHill, nbHills); | createHills([tDirt2, tCliff, tGrassShrubs], avoidClasses(clPlayer, 30, clHill, 15), clHill, nbHills); | ||||||||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Implicit unpredictable paths should be avoided. Warn and use default circle instead.