Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/rmgen-common/wall_builder.js
Show First 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Prepare a wall element for inclusion in a style. | * Prepare a wall element for inclusion in a style. | ||||
* | * | ||||
* @param {string} path - The template path to read values from | * @param {string} path - The template path to read values from | ||||
*/ | */ | ||||
function readyWallElement(path, civCode) | function readyWallElement(path, civCode) | ||||
{ | { | ||||
path = path.replace(/\{civ\}/g, civCode); | path = path.replace(/\{civ\}/g, civCode); | ||||
let template = GetTemplateDataHelper(Engine.GetTemplate(path), null, null, {}, g_DamageTypes, {}); | let template = GetTemplateDataHelper(Engine.GetTemplate(path), null, null, {}, {}); | ||||
let length = template.wallPiece ? template.wallPiece.length : template.obstruction.shape.width; | let length = template.wallPiece ? template.wallPiece.length : template.obstruction.shape.width; | ||||
return deepfreeze({ | return deepfreeze({ | ||||
"templateName": path, | "templateName": path, | ||||
"angle": template.wallPiece ? template.wallPiece.angle : Math.PI, | "angle": template.wallPiece ? template.wallPiece.angle : Math.PI, | ||||
"length": length / TERRAIN_TILE_SIZE, | "length": length / TERRAIN_TILE_SIZE, | ||||
"indent": template.wallPiece ? template.wallPiece.indent / TERRAIN_TILE_SIZE : 0, | "indent": template.wallPiece ? template.wallPiece.indent / TERRAIN_TILE_SIZE : 0, | ||||
"bend": template.wallPiece ? template.wallPiece.bend : 0 | "bend": template.wallPiece ? template.wallPiece.bend : 0 | ||||
▲ Show 20 Lines • Show All 654 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator