Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/caledonian_meadows.js
Show First 20 Lines • Show All 299 Lines • ▼ Show 20 Lines | let decorations = [ | ||||
"actor|geology/highland1.xml", "actor|geology/highland2.xml", "actor|geology/highland3.xml", | "actor|geology/highland1.xml", "actor|geology/highland2.xml", "actor|geology/highland3.xml", | ||||
"actor|geology/highland_c.xml", "actor|geology/highland_d.xml", "actor|geology/highland_e.xml", | "actor|geology/highland_c.xml", "actor|geology/highland_d.xml", "actor|geology/highland_e.xml", | ||||
"actor|props/flora/bush.xml", "actor|props/flora/bush_dry_a.xml", "actor|props/flora/bush_highlands.xml", | "actor|props/flora/bush.xml", "actor|props/flora/bush_dry_a.xml", "actor|props/flora/bush_highlands.xml", | ||||
"actor|props/flora/bush_tempe_a.xml", "actor|props/flora/bush_tempe_b.xml", "actor|props/flora/ferns.xml" | "actor|props/flora/bush_tempe_a.xml", "actor|props/flora/bush_tempe_b.xml", "actor|props/flora/ferns.xml" | ||||
]; | ]; | ||||
function placeMine(point, centerEntity) | function placeMine(point, centerEntity) | ||||
{ | { | ||||
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 = i * dAngle + randFloat(0, dAngle); | let angle = i * dAngle + randFloat(0, dAngle); | ||||
let dist = randFloat(2, 5); | let dist = randFloat(2, 5); | ||||
placeObject(point.x + dist * Math.cos(angle), point.y + dist * Math.sin(angle), pickRandom(decorations), 0, randFloat(0, 2 * PI)); | placeObject(point.x + dist * Math.cos(angle), point.y + dist * Math.sin(angle), pickRandom(decorations), 0, randFloat(0, 2 * PI)); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 56 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 = i * dAngle + randFloat(0, dAngle); | let angle = i * dAngle + randFloat(0, dAngle); | ||||
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 389 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator