Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/danubius.js
RMS.LoadLibrary("rmgen"); | RMS.LoadLibrary("rmgen"); | ||||
// Spawn ships away from the shoreline, but patrol close to the shoreline | // Spawn ships away from the shoreline, but patrol close to the shoreline | ||||
const triggerPointShipSpawn = "special/trigger_point_A"; | const triggerPointShipSpawn = "special/trigger_point_A"; | ||||
const triggerPointShipPatrol = "special/trigger_point_B"; | const triggerPointShipPatrol = "special/trigger_point_B"; | ||||
const triggerPointShipUnloadLeft = "special/trigger_point_C"; | const triggerPointShipUnloadLeft = "special/trigger_point_C"; | ||||
const triggerPointShipUnloadRight = "special/trigger_point_D"; | const triggerPointShipUnloadRight = "special/trigger_point_D"; | ||||
const triggerPointLandPatrolLeft = "special/trigger_point_E"; | const triggerPointLandPatrolLeft = "special/trigger_point_E"; | ||||
const triggerPointLandPatrolRight = "special/trigger_point_F"; | const triggerPointLandPatrolRight = "special/trigger_point_F"; | ||||
const triggerPointCCAttackerPatrolLeft = "special/trigger_point_G"; | |||||
const triggerPointCCAttackerPatrolRight = "special/trigger_point_H"; | |||||
// Terrain textures | // Terrain textures | ||||
const tRoad = "steppe_river_rocks"; | const tRoad = "steppe_river_rocks"; | ||||
const tIsland = ["temp_grass_long_b_aut", "temp_grass_plants_aut", "temp_forestfloor_aut"]; | const tIsland = ["temp_grass_long_b_aut", "temp_grass_plants_aut", "temp_forestfloor_aut"]; | ||||
const tCliff = "temp_cliff_a"; | const tCliff = "temp_cliff_a"; | ||||
const tForestFloor = "temp_forestfloor_aut"; | const tForestFloor = "temp_forestfloor_aut"; | ||||
const tGrass = "medit_shrubs_golden"; | const tGrass = "medit_shrubs_golden"; | ||||
const tGrass2 ="grass_mediterranean_dry_1024test"; | const tGrass2 ="grass_mediterranean_dry_1024test"; | ||||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
const ShorelineDistance = 15; | const ShorelineDistance = 15; | ||||
log("Initializing map..."); | log("Initializing map..."); | ||||
InitMap(); | InitMap(); | ||||
const numPlayers = getNumPlayers(); | const numPlayers = getNumPlayers(); | ||||
const mapSize = getMapSize(); | const mapSize = getMapSize(); | ||||
var clMiddle = createTileClass(); | |||||
var clPlayer = createTileClass(); | var clPlayer = createTileClass(); | ||||
var clForest = createTileClass(); | var clForest = createTileClass(); | ||||
var clWater = createTileClass(); | var clWater = createTileClass(); | ||||
var clLand = [createTileClass(), createTileClass()]; | var clLand = [createTileClass(), createTileClass()]; | ||||
var clLandPatrolPoint = [createTileClass(), createTileClass()]; | var clLandPatrolPoint = [createTileClass(), createTileClass()]; | ||||
var clCCAttackerPatrolPoint = [createTileClass(), createTileClass()]; | |||||
var clShore = [createTileClass(), createTileClass()]; | var clShore = [createTileClass(), createTileClass()]; | ||||
var clShoreUngarrisonPoint = [createTileClass(), createTileClass()]; | var clShoreUngarrisonPoint = [createTileClass(), createTileClass()]; | ||||
var clShip = createTileClass(); | var clShip = createTileClass(); | ||||
var clShipPatrol = createTileClass(); | var clShipPatrol = createTileClass(); | ||||
var clDirt = createTileClass(); | var clDirt = createTileClass(); | ||||
var clRock = createTileClass(); | var clRock = createTileClass(); | ||||
var clMetal = createTileClass(); | var clMetal = createTileClass(); | ||||
var clFood = createTileClass(); | var clFood = createTileClass(); | ||||
Show All 13 Lines | |||||
// How many treasures will be placed near the gallic civic centers | // How many treasures will be placed near the gallic civic centers | ||||
var gallicCCTreasureCount = randIntInclusive(8, 12); | var gallicCCTreasureCount = randIntInclusive(8, 12); | ||||
// How many treasures will be placed randomly on the map at most | // How many treasures will be placed randomly on the map at most | ||||
var randomTreasureCount = randIntInclusive(0, 3 * numPlayers); | var randomTreasureCount = randIntInclusive(0, 3 * numPlayers); | ||||
// Place a gaia village on small maps and larger | // Place a gaia village on small maps and larger | ||||
if (mapSize >= smallMapSize) | var gallicCC = mapSize >= smallMapSize; | ||||
if (gallicCC) | |||||
Sandarac: `gallicCC` -> `gaiaCC`. | |||||
Not Done Inline ActionsBut then we should rename gallicCCTreasureCount to gaiaCCTreasureCount too (and not have it treasureCount as other treasure exists too potentially). I can rename it (trivial), but if we search for "gallic" we can find many other occurances while we find only 2 gaia occurances elexis: But then we should rename gallicCCTreasureCount to gaiaCCTreasureCount too (and not have it… | |||||
{ | { | ||||
log("Creating gallic villages..."); | log("Creating gallic villages..."); | ||||
let gaulCityRadius = 12; | let gaulCityRadius = 12; | ||||
let gaulCityBorderDistance = mapSize < mediumMapSize ? 10 : 18; | let gaulCityBorderDistance = mapSize < mediumMapSize ? 10 : 18; | ||||
// Whether to add a celtic ritual and a path from the gallic city leading to it | // Whether to add a celtic ritual and a path from the gallic city leading to it | ||||
let addCelticRitual = randBool(0.9); | let addCelticRitual = randBool(0.9); | ||||
▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | for (let i = 0; i < 2; ++i) | ||||
// Replace stone walls with palisade walls | // Replace stone walls with palisade walls | ||||
for (let template of ["gate", "wallLong", "cornerIn", "cornerOut"]) | for (let template of ["gate", "wallLong", "cornerIn", "cornerOut"]) | ||||
wallStyles.gaul[template] = wallStyles.palisades[template]; | wallStyles.gaul[template] = wallStyles.palisades[template]; | ||||
let wall = [ | let wall = [ | ||||
"gate", "hut", "palisade_tower", "wallLong", "wallLong", | "gate", "hut", "palisade_tower", "wallLong", "wallLong", | ||||
"cornerIn", "defense_tower", "wallLong", "wallLong", "temple", | "cornerIn", "defense_tower", "wallLong", "wallLong", "temple", | ||||
"palisade_tower", "wallLong", "house", "wallLong", "palisade_tower", "longhouse", "wallLong", "wallLong", | "palisade_tower", "wallLong", "house", "gate", "palisade_tower", "longhouse", "wallLong", "wallLong", | ||||
"cornerIn", "defense_tower", "wallLong", "tavern", "wallLong", "palisade_tower"]; | "cornerIn", "defense_tower", "wallLong", "tavern", "wallLong", "palisade_tower"]; | ||||
wall = wall.concat(wall); | wall = wall.concat(wall); | ||||
placeCustomFortress(gX, gZ, new Fortress("Geto-Dacian Tribal Confederation", wall), "gaul", 0, PI); | placeCustomFortress(gX, gZ, new Fortress("Geto-Dacian Tribal Confederation", wall), "gaul", 0, PI); | ||||
// Place spikes | // Place spikes | ||||
wallStyles.palisades.tall_spikes = new WallElement("tall_spikes", oTallSpikes, PI/2, 2); | wallStyles.palisades.tall_spikes = new WallElement("tall_spikes", oTallSpikes, PI/2, 2); | ||||
wallStyles.palisades.spikeIn = new WallElement("spikeIn", oAngleSpikes, -PI/4, 2.1, 0.7, PI/2); | wallStyles.palisades.spikeIn = new WallElement("spikeIn", oAngleSpikes, -PI/4, 2.1, 0.7, PI/2); | ||||
wallStyles.palisades.spikeMid = new WallElement("spikeIn", oAngleSpikes, -PI/2, 0.7); | wallStyles.palisades.spikeMid = new WallElement("spikeIn", oAngleSpikes, -PI/2, 0.7); | ||||
▲ Show 20 Lines • Show All 221 Lines • ▼ Show 20 Lines | |||||
log("Creating islands..."); | log("Creating islands..."); | ||||
createAreas( | createAreas( | ||||
new ChainPlacer(Math.floor(scaleByMapSize(3, 4)), Math.floor(scaleByMapSize(4, 8)), Math.floor(scaleByMapSize(50, 80)), 0.5), | new ChainPlacer(Math.floor(scaleByMapSize(3, 4)), Math.floor(scaleByMapSize(4, 8)), Math.floor(scaleByMapSize(50, 80)), 0.5), | ||||
[ | [ | ||||
new LayeredPainter([tWater, tShore, tIsland], [2, 1]), | new LayeredPainter([tWater, tShore, tIsland], [2, 1]), | ||||
new SmoothElevationPainter(ELEVATION_SET, 6, 4), | new SmoothElevationPainter(ELEVATION_SET, 6, 4), | ||||
paintClass(clIsland) | paintClass(clIsland) | ||||
], | ], | ||||
[avoidClasses(clIsland, 30), stayClasses (clWater, 8)], | [avoidClasses(clIsland, 30), stayClasses (clWater, 8)], | ||||
Not Done Inline ActionsCommitted in rP19705 elexis: Committed in rP19705 | |||||
scaleByMapSize(1, 4) * numPlayers | scaleByMapSize(1, 4) * numPlayers | ||||
); | ); | ||||
RMS.SetProgress(60); | RMS.SetProgress(60); | ||||
log("Creating island bumps..."); | log("Creating island bumps..."); | ||||
createBumps(stayClasses(clIsland, 2), scaleByMapSize(50, 400), 1, 8, 4, 0, 3); | createBumps(stayClasses(clIsland, 2), scaleByMapSize(50, 400), 1, 8, 4, 0, 3); | ||||
log("Paint seabed..."); | log("Paint seabed..."); | ||||
▲ Show 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | new SimpleGroup( | ||||
clShoreUngarrisonPoint[i]), | clShoreUngarrisonPoint[i]), | ||||
0, | 0, | ||||
[avoidClasses(clShoreUngarrisonPoint[i], 4), stayClasses(clShore[i], 0)], | [avoidClasses(clShoreUngarrisonPoint[i], 4), stayClasses(clShore[i], 0)], | ||||
20000, | 20000, | ||||
1 | 1 | ||||
); | ); | ||||
log("Creating patrol points for land attackers..."); | log("Creating patrol points for land attackers..."); | ||||
addToClass(mapSize/2, mapSize/2, clMiddle); | |||||
for (let i = 0; i < 2; ++i) | for (let i = 0; i < 2; ++i) | ||||
{ | |||||
createObjectGroups( | createObjectGroups( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[new SimpleObject( | [new SimpleObject( | ||||
i == 0 ? triggerPointLandPatrolLeft : triggerPointLandPatrolRight, | i == 0 ? triggerPointLandPatrolLeft : triggerPointLandPatrolRight, | ||||
1, 1, | 1, 1, | ||||
0, 0)], | 0, 0)], | ||||
true, | true, | ||||
clLandPatrolPoint[i]), | clLandPatrolPoint[i]), | ||||
0, | 0, | ||||
[ | [ | ||||
avoidClasses(clWater, 5, clForest, 3, clHill, 3, clFood, 1, clRock, 5, clMetal, 5, clPlayer, 10, clGauls, 5, clLandPatrolPoint[i], 5), | avoidClasses(clWater, 5, clForest, 3, clHill, 3, clFood, 1, clRock, 5, clMetal, 5, clPlayer, 10, clGauls, 5, clLandPatrolPoint[i], 5), | ||||
stayClasses(clLand[i], 0) | stayClasses(clLand[i], 0) | ||||
], | ], | ||||
10000, | 10000, | ||||
100 | 100 | ||||
); | ); | ||||
if (gallicCC) | |||||
createObjectGroups( | |||||
new SimpleGroup( | |||||
[new SimpleObject( | |||||
i == 0 ? triggerPointCCAttackerPatrolLeft : triggerPointCCAttackerPatrolRight, | |||||
1, 1, | |||||
0, 0)], | |||||
true, | |||||
clCCAttackerPatrolPoint[i]), | |||||
0, | |||||
[ | |||||
// Don't avoid the forest, so that as many places as possible on the border are visited | |||||
avoidClasses( | |||||
clWater, 5, | |||||
clHill, 3, | |||||
clFood, 1, | |||||
clRock, 4, | |||||
clMetal, 4, | |||||
clPlayer, 15, | |||||
clGauls, 0, | |||||
clCCAttackerPatrolPoint[i], 5, | |||||
clMiddle, mapSize * 0.5 - 15), | |||||
stayClasses(clLand[i], 0) | |||||
], | |||||
10000, | |||||
100 | |||||
); | |||||
} | |||||
log("Creating water logs..."); | log("Creating water logs..."); | ||||
createObjectGroups( | createObjectGroups( | ||||
new SimpleGroup([new SimpleObject(aWaterLog, 1, 1, 0, 0)], true, clWaterLog), | new SimpleGroup([new SimpleObject(aWaterLog, 1, 1, 0, 0)], true, clWaterLog), | ||||
0, | 0, | ||||
[avoidClasses(clShip, 3, clIsland, 4), stayClasses(clWater, 4)], | [avoidClasses(clShip, 3, clIsland, 4), stayClasses(clWater, 4)], | ||||
scaleByMapSize(15, 60), | scaleByMapSize(15, 60), | ||||
100 | 100 | ||||
); | ); | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
gallicCC -> gaiaCC.