company_static_util¶
Source: base/tealdef/game_mechanics/company/company_static_util.d.tl
Notes
Rank names and permit-key definitions (company_permit_key resources).
CompanyStaticUtil¶
record global base/tealdef/game_mechanics/company/company_static_util.d.tl:3
global record CompanyStaticUtil
Load: local company_static_util = ug_require "/game_mechanics/company/company_static_util.tl"
Notes
Rank names and permit-key definitions.
Functions
getRole(companyLevel : integer) : string base/tealdef/game_mechanics/company/company_static_util.d.tl:31
Call as company_static_util.getRole
Notes
Returns the name of a rank (1 "Junior" to 15 "Tycoon").
| Parameter | Type | Description |
|---|---|---|
companyLevel |
integer |
Rank. |
Returns string: Rank name, or "Rank n" outside 1..15.
Used in the base game: 8 times in 6 files
base/content/gui/gui/game_bar/game_bar.tl:420
base/content/gui/gui/menu/savegame_react_util.tl:588
rows[#rows + 1] = makeLeftRightTextView(_("Company Rank"), company_static_util.getRole(companyMetadata.level))
base/content/game_mechanics/game_mechanics/company/company_react_util.tl:87
base/content/game_mechanics/game_mechanics/company/company_util.tl:176
return lang_util.format(_("Unlocked at Rank: {rank}"), {rank = company_static_util.getRole(minRank)})
base/content/game_mechanics/game_mechanics/company/company_notification_rank_up.script.tl:16
description = lang_util.format(_("Hard work and endurance are paying off. You got promoted to {role} and great rewards have been unlocked."), { role = company_s
base/content/game_mechanics/game_mechanics/celebrations/celebration_react_util.tl:56
getPermitKeyName(permitKey : ResName) : string base/tealdef/game_mechanics/company/company_static_util.d.tl:34
Call as company_static_util.getPermitKeyName
get name of the permitKey (if nil is returned, use construction as key)
Returns string
getPermitKeyDesc(permitKey : ResName) : PermitKeyDesc base/tealdef/game_mechanics/company/company_static_util.d.tl:37
Call as company_static_util.getPermitKeyDesc
get permit key definition as stored in the resource
Returns PermitKeyDesc
Used in the base game: 3 times in 3 files
base/content/gui/gui/construction/construction_desc_react_util.tl:592
base/content/game_mechanics/game_mechanics/company/company_react_util.tl:62
base/content/game_mechanics/game_mechanics/company/company_util.tl:101
getExtraPermitsAggregatedPerRank() : {string : {{integer, integer}}} base/tealdef/game_mechanics/company/company_static_util.d.tl:40
Call as company_static_util.getExtraPermitsAggregatedPerRank
note: this is cached and thus cheap (for each key, returns list of {level, total permits up to and including level}
Returns {string : {{integer, integer}}}
getMinRankConsideringPermits(companyMeta : CompanyMetadata.ConstructionDesc) : integer base/tealdef/game_mechanics/company/company_static_util.d.tl:42
Call as company_static_util.getMinRankConsideringPermits
Notes
Returns the rank at which a construction unlocks, from companyRank, the first rankAndPermits entry or its permit key.
| Parameter | Type | Description |
|---|---|---|
companyMeta |
CompanyMetadata.ConstructionDesc |
Company metadata of the construction. |
Returns integer: Rank, or nil.
Used in the base game: 3 times in 2 files
base/content/gui/gui/construction/construction_react_util.tl:707
base/content/game_mechanics/game_mechanics/company/company_util.tl:173
getAllRanksConsideringPermits(companyMeta : CompanyMetadata.ConstructionDesc) : {integer} base/tealdef/game_mechanics/company/company_static_util.d.tl:44
Call as company_static_util.getAllRanksConsideringPermits
Notes
Returns all ranks at which a construction unlocks or gains permits.
| Parameter | Type | Description |
|---|---|---|
companyMeta |
CompanyMetadata.ConstructionDesc |
Company metadata of the construction. |
Returns {integer}: Ranks, or nil.
CompanyStaticUtil.PerkDescription¶
record base/tealdef/game_mechanics/company/company_static_util.d.tl:5
record PerkDescription
Notes
A perk as listed under a rank in the company window.
Used in the base game: 7 times in 2 files
base/content/game_mechanics/game_mechanics/company/company.tl:44
base/content/game_mechanics/game_mechanics/company/company_react_util.tl:32
Fields
| Name | Type | Description |
|---|---|---|
name |
string |
Name of the perk. |
description |
string |
Description of the perk. |
icon |
IconWithAvailability |
Icon of the perk. |
permitKey |
ResName |
Permit key of the perk. |
permits |
integer |
how often can it be built? (nil means unlimited) |
isNewUnlock |
boolean |
The perk unlocks at this rank; false means it only gains permits here. |
cooldownInSeconds |
number |
Cooldown of a used permit, in game seconds. |
recycle |
boolean |
re-gain permits after bulldozing |
category |
CompanyMetadata.ConstructionDesc.PerkCategory |
Kind of perk. |
numbers |
ConstructionDescReactUtil.Numbers |
Figures shown in the description. |
CompanyStaticUtil.RankDescription¶
record base/tealdef/game_mechanics/company/company_static_util.d.tl:18
record RankDescription
Notes
A rank in the company window.
Used in the base game: 15 times in 2 files
base/content/game_mechanics/game_mechanics/company/company.tl:19
base/content/game_mechanics/game_mechanics/company/company_react_util.tl:10
Fields
| Name | Type | Description |
|---|---|---|
level |
integer |
Rank number. |
role |
string |
Rank name (e.g. "Junior", "CEO"). |
requiredExp |
integer |
Experience needed. |
perks |
{PerkDescription} |
Perks unlocked or extended at this rank. |
CompanyStaticUtil.PermitKeyDesc¶
record base/tealdef/game_mechanics/company/company_static_util.d.tl:25
record PermitKeyDesc
Notes
Data of a company_permit_key resource.
Used in the base game: 5 times in 1 file
base/content/game_mechanics/game_mechanics/company/company_static_util.tl:34
Fields