fun_elements¶
Source: base/tealdef/game_mechanics/fun_elements/fun_elements.d.tl
Notes
State and helpers of the fun elements game script (airships over towns, UFOs abducting cows).
Globals¶
Types
| Name | Definition | Description |
|---|---|---|
BlimpUtil |
declared here, defined in BlimpUtil |
Airship that flies to a town when a marketing campaign starts there, circles it while the campaign runs, and then leaves the map. |
UfoUtil |
declared here, defined in UfoUtil |
UFO that flies in from the map edge, lifts a cow from a livestock farm field and flies off again. |
FunElementsState¶
record global base/tealdef/game_mechanics/fun_elements/fun_elements.d.tl:6
global record FunElementsState
Notes
Saved state of the game script ::/game_mechanics/fun_elements/fun_elements.gs.
Fields
| Name | Type | Description |
|---|---|---|
blimps |
{BlimpUtil.BlimpData} |
Airships in flight. |
ufos |
{UfoUtil.UfoData} |
UFOs in flight. |
spawnNextUfoAtGameTime |
number |
Game time (ms) of the next UFO, 2 to 4 game years after the previous one is gone. |
FunElementType¶
enum global base/tealdef/game_mechanics/fun_elements/fun_elements.d.tl:13
global enum FunElementType
Notes
Kind of a fun element entity.
| Value | Description |
|---|---|
"Blimp" |
Airship. |
"Ufo" |
UFO. |
"Cow" |
Cow spawned for a UFO to abduct. |
FunElementsUtil¶
record global base/tealdef/game_mechanics/fun_elements/fun_elements.d.tl:19
global record FunElementsUtil
Load: local fun_elements_util = ug_require "/game_mechanics/fun_elements/fun_elements_util.tl"
Notes
Access to the fun elements state.
Functions
externalGetFunElementsState() : FunElementsState base/tealdef/game_mechanics/fun_elements/fun_elements.d.tl:20
Call as fun_elements_util.externalGetFunElementsState
Notes
Reads the state of the fun elements game script.
Returns FunElementsState: The state.
getFunElementType(entity : Engine.Entity) : FunElementType base/tealdef/game_mechanics/fun_elements/fun_elements.d.tl:21
Call as fun_elements_util.getFunElementType
Notes
Kind of fun element an entity is. The tooltip and the entity window use it.
| Parameter | Type | Description |
|---|---|---|
entity |
Engine.Entity |
Entity to check. |
Returns FunElementType: The kind, or nil if the entity is no fun element.
Used in the base game: 3 times in 3 files
base/content/gui/gui/main/game_tooltips.tl:75
base/content/gui/gui/entity_window/make_entity_window.tl:688
base/content/gui/gui/entity_window/view_manager_util.tl:285
funElementTypeToString(elementType : FunElementType) : string base/tealdef/game_mechanics/fun_elements/fun_elements.d.tl:22
Call as fun_elements_util.funElementTypeToString
Notes
Translated name of a fun element kind ("Airship", "UFO", "Cow").
| Parameter | Type | Description |
|---|---|---|
elementType |
FunElementType |
Kind. |
Returns string: The name, or nil for unknown kinds.