Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/wild_lake.js
Show First 20 Lines • Show All 477 Lines • ▼ Show 20 Lines | function placeMine(point, centerEntity, | ||||
decorativeActors = [ | decorativeActors = [ | ||||
g_Decoratives.grass, g_Decoratives.grassShort, | g_Decoratives.grass, g_Decoratives.grassShort, | ||||
g_Decoratives.rockLarge, g_Decoratives.rockMedium, | g_Decoratives.rockLarge, g_Decoratives.rockMedium, | ||||
g_Decoratives.bushMedium, g_Decoratives.bushSmall | g_Decoratives.bushMedium, g_Decoratives.bushSmall | ||||
] | ] | ||||
) | ) | ||||
{ | { | ||||
placeObject(point.x, point.y, centerEntity, 0, randFloat(0, TWO_PI)); | placeObject(point.x, point.y, centerEntity, 0, randFloat(0, TWO_PI)); | ||||
let quantity = randInt(11, 23); | let quantity = randIntInclusive(11, 23); | ||||
let dAngle = TWO_PI / quantity; | let dAngle = TWO_PI / quantity; | ||||
for (let i = 0; i < quantity; ++i) | for (let i = 0; i < quantity; ++i) | ||||
{ | { | ||||
let angle = dAngle * randFloat(i, i + 1); | let angle = dAngle * randFloat(i, i + 1); | ||||
let dist = randFloat(2, 5); | let dist = randFloat(2, 5); | ||||
placeObject(point.x + dist * Math.cos(angle), point.y + dist * Math.sin(angle), pickRandom(decorativeActors), 0, randFloat(0, 2 * PI)); | placeObject(point.x + dist * Math.cos(angle), point.y + dist * Math.sin(angle), pickRandom(decorativeActors), 0, randFloat(0, 2 * PI)); | ||||
} | } | ||||
} | } | ||||
Show All 9 Lines | groveEntities = [ | ||||
g_Gaia.tree3, g_Gaia.tree3, g_Gaia.tree3, | g_Gaia.tree3, g_Gaia.tree3, g_Gaia.tree3, | ||||
g_Gaia.tree4, g_Gaia.tree4, g_Gaia.tree5 | g_Gaia.tree4, g_Gaia.tree4, g_Gaia.tree5 | ||||
], | ], | ||||
groveActors = [g_Decoratives.grass, g_Decoratives.rockMedium, g_Decoratives.bushMedium], groveTileClass = undefined, | groveActors = [g_Decoratives.grass, g_Decoratives.rockMedium, g_Decoratives.bushMedium], groveTileClass = undefined, | ||||
groveTerrainTexture = getArray(g_Terrains.forestFloor1) | groveTerrainTexture = getArray(g_Terrains.forestFloor1) | ||||
) | ) | ||||
{ | { | ||||
placeObject(point.x, point.y, pickRandom(["structures/gaul_outpost", "gaia/flora_tree_oak_new"]), 0, randFloat(0, 2 * PI)); | placeObject(point.x, point.y, pickRandom(["structures/gaul_outpost", "gaia/flora_tree_oak_new"]), 0, randFloat(0, 2 * PI)); | ||||
let quantity = randInt(20, 30); | let quantity = randIntInclusive(20, 30); | ||||
let dAngle = TWO_PI / quantity; | let dAngle = TWO_PI / quantity; | ||||
for (let i = 0; i < quantity; ++i) | for (let i = 0; i < quantity; ++i) | ||||
{ | { | ||||
let angle = dAngle * randFloat(i, i + 1); | let angle = dAngle * randFloat(i, i + 1); | ||||
let dist = randFloat(2, 5); | let dist = randFloat(2, 5); | ||||
let objectList = groveEntities; | let objectList = groveEntities; | ||||
if (i % 3 == 0) | if (i % 3 == 0) | ||||
objectList = groveActors; | objectList = groveActors; | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | function placeCamp(point, | ||||
centerEntity = "actor|props/special/eyecandy/campfire.xml", | centerEntity = "actor|props/special/eyecandy/campfire.xml", | ||||
otherEntities = ["gaia/special_treasure_metal", "gaia/special_treasure_standing_stone", | otherEntities = ["gaia/special_treasure_metal", "gaia/special_treasure_standing_stone", | ||||
"units/brit_infantry_slinger_b", "units/brit_infantry_javelinist_b", "units/gaul_infantry_slinger_b", "units/gaul_infantry_javelinist_b", "units/gaul_champion_fanatic", | "units/brit_infantry_slinger_b", "units/brit_infantry_javelinist_b", "units/gaul_infantry_slinger_b", "units/gaul_infantry_javelinist_b", "units/gaul_champion_fanatic", | ||||
"actor|props/special/common/waypoint_flag.xml", "actor|props/special/eyecandy/barrel_a.xml", "actor|props/special/eyecandy/basket_celt_a.xml", "actor|props/special/eyecandy/crate_a.xml", "actor|props/special/eyecandy/dummy_a.xml", "actor|props/special/eyecandy/handcart_1.xml", "actor|props/special/eyecandy/handcart_1_broken.xml", "actor|props/special/eyecandy/sack_1.xml", "actor|props/special/eyecandy/sack_1_rough.xml" | "actor|props/special/common/waypoint_flag.xml", "actor|props/special/eyecandy/barrel_a.xml", "actor|props/special/eyecandy/basket_celt_a.xml", "actor|props/special/eyecandy/crate_a.xml", "actor|props/special/eyecandy/dummy_a.xml", "actor|props/special/eyecandy/handcart_1.xml", "actor|props/special/eyecandy/handcart_1_broken.xml", "actor|props/special/eyecandy/sack_1.xml", "actor|props/special/eyecandy/sack_1_rough.xml" | ||||
] | ] | ||||
) | ) | ||||
{ | { | ||||
placeObject(point.x, point.y, centerEntity, 0, randFloat(0, TWO_PI)); | placeObject(point.x, point.y, centerEntity, 0, randFloat(0, TWO_PI)); | ||||
let quantity = randInt(5, 11); | let quantity = randIntInclusive(5, 11); | ||||
let dAngle = TWO_PI / quantity; | let dAngle = TWO_PI / quantity; | ||||
for (let i = 0; i < quantity; ++i) | for (let i = 0; i < quantity; ++i) | ||||
{ | { | ||||
let angle = dAngle * randFloat(i, i + 1); | let angle = dAngle * randFloat(i, i + 1); | ||||
let dist = randFloat(1, 3); | let dist = randFloat(1, 3); | ||||
placeObject(point.x + dist * Math.cos(angle), point.y + dist * Math.sin(angle), pickRandom(otherEntities), 0, randFloat(0, 2 * PI)); | placeObject(point.x + dist * Math.cos(angle), point.y + dist * Math.sin(angle), pickRandom(otherEntities), 0, randFloat(0, 2 * PI)); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 381 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator