Skip to content

landmark_util

Source: base/tealdef/landmarks/landmark_util.d.tl

Notes

Types of /landmarks/landmark_util.tl (LandmarkEngineUtil), which adds up the town bonuses that finished landmarks and the headquarter grant to their closest town.

LandmarkEngineUtil

record global base/tealdef/landmarks/landmark_util.d.tl:3

global record LandmarkEngineUtil

Load: local landmark_util = ug_require "landmark_util.tl"

Notes

Landmark bonus helpers returned by ug_require "/landmarks/landmark_util.tl".

Functions

collectTownGrowthMetadata(constructionEntity : Engine.Entity, construction : Engine.Component.Construction, townBoni : {Engine.Entity : TownBonuses}, singleTown? : Engine.Entity) base/tealdef/landmarks/landmark_util.d.tl:14

Call as landmark_util.collectTownGrowthMetadata

Notes

Adds a construction's town_growth bonuses to the entry of its closest town in townBoni.

Parameter Type Description
constructionEntity Engine.Entity
construction Engine.Component.Construction
townBoni {Engine.Entity : TownBonuses}
singleTown? Engine.Entity If set, only that town is considered.

collectVehiclesBonusesMetadata(constructionEntity : Engine.Entity, construction : Engine.Component.Construction, townBoni : {Engine.Entity : TownBonuses}, singleTown? : Engine.Entity) base/tealdef/landmarks/landmark_util.d.tl:15

Call as landmark_util.collectVehiclesBonusesMetadata

Notes

Adds the effects of a construction's constructionConfig to the carrierModifiers of its closest town in townBoni.

Parameter Type Description
constructionEntity Engine.Entity
construction Engine.Component.Construction
townBoni {Engine.Entity : TownBonuses}
singleTown? Engine.Entity If set, only that town is considered.

getTownBonuses(includeTownGrowth : boolean, includeVehicles : boolean, town : Engine.Entity) : TownBonuses base/tealdef/landmarks/landmark_util.d.tl:16

Call as landmark_util.getTownBonuses

Notes

Sums the bonuses of all constructions whose closest town is town.

Parameter Type Description
includeTownGrowth boolean Include town_growth bonuses.
includeVehicles boolean Include vehicle bonuses from constructionConfig.effects.
town Engine.Entity The town entity.

Returns TownBonuses: The bonuses; an empty table (and an error in the log) if both flags are false.

LandmarkEngineUtil.TownBonuses

record base/tealdef/landmarks/landmark_util.d.tl:4

record TownBonuses

Notes

Bonuses a town receives from landmarks and headquarters.

Used in the base game: 7 times in 4 files

base/content/landmarks/landmarks.script.tl:18

local townsBoni : {Engine.Entity : LandmarkEngineUtil.TownBonuses} = {}
base/content/landmarks/landmark_util.tl:21
landmark_util.collectVehiclesBonusesMetadata = function(constructionEntity : Engine.Entity, construction : Engine.Component.Construction, townBoni : {Engine.Ent
base/content/game_mechanics/game_mechanics/towns/towns.script.tl:195
local townsBonuses : {Engine.Entity : LandmarkEngineUtil.TownBonuses} = {}
base/content/game_mechanics/game_mechanics/towns/town_react_util.tl:1181
townBonuses : LandmarkEngineUtil.TownBonuses

Fields

Name Type Description
xpIncrease LandmarksModifierValue Town experience bonus (from town_growth metadata).
trafficRatingIncrease LandmarksModifierValue Traffic rating bonus (from town_growth metadata).
reputationRecoveryBoost LandmarksModifierValue Reputation recovery bonus (from town_growth metadata).
carrierModifiers {string : {string : LandmarksModifierValue}} Vehicle bonuses by carrier and effect type, from the effects of constructionConfig.

LandmarkEngineUtil.TownBonuses.LandmarksModifierValue

record base/tealdef/landmarks/landmark_util.d.tl:5

record LandmarksModifierValue

Notes

Sum of one bonus and the constructions that contribute to it.

Fields

Name Type Description
value number Summed bonus value.
landmarks {Engine.Entity} Construction entities that contribute.