Skip to main content

World

The world interface

Properties

id

World.id: string

Get/Set the world identifier (e.g. "forest")

id_change

World.id_change: boolean

Get the flag marking a world id change since the last room change

shift_applied

World.shift_applied: boolean

Get the flag marking last room change was a shift

shift_disable

World.shift_disable: boolean

Get/Set the flag disabling the player shifting between rooms

pos

World.pos: table

Get/Set the world position (x/y/z)

x

World.x: number

Get/Set the world x coordinate

y

World.y: number

Get/Set the world y coordinate

z

World.z: number

Get/Set the world z coordinate

seed

World.seed: number

Get the global world seed

seed_room

World.seed_room: number

Get the room seed (current x, y, z)

The room seed is based on the world and regional seed

seed_region

World.seed_region: number

Get the region seed (current id)

The regional seed may change on a regional reset

stage_level

World.stage_level: number

Get/Set the global stage level.

dungeon_level

World.dungeon_level: number

Get/Set the global dungeon level.

music_level

World.music_level: number

Get/Set the global music level.

fog_intensity

deprecated
World.fog_intensity: number

You can use a shader instead.

gravity

World.gravity: table

Get/Set the current gravity

gravity_x

World.gravity_x: number

Get/Set the current horizontal gravity

gravity_y

World.gravity_y: number

Get/Set the current vertical gravity

difficulty

World.difficulty: DifficultyRef

Get the current difficulty

mode

World.mode: string

Get/Set the current mode

mode_play

World.mode_play: string

Get/Set the current play mode

Play Modes

Value
Rogue
Adventure

mode_life

World.mode_life: string

Get/Set the current life mode

Life Modes

Value Description
Reset Reset in room on death
Health Death when health is 0

mirror

World.mirror: string

Get the current room mirror

Mirrors

Value Description
empty no mirror
I horizontal mirror
- vertical mirror
X point mirror

template

World.template: TemplateRef

Get the template at the current position.

elapsed

World.elapsed: number

Get the elapsed seconds of the world simulation

elapsed_room

World.elapsed_room: number

Get the elapsed seconds of the world simulation since entering the room

elapsed_visual

World.elapsed_visual: number

Get the elapsed seconds of the visual world simulation

Functions

purge

World.purge(
optionstable--

settings

) → ()

Purge a region from the global world state

Options

Name Type Default Description
locals bool true purge locals from region
seed bool true purge seeds from region
doors bool true purge doors from region

stage_advance

World.stage_advance() → ()

Advances progression by one stage

Increases the stage level by one without adjusting the offset

warp

World.warp(
idstring,--

region identifier

optionstable--

settings

) → ()

Sets the current room

Options

Name Type Default Description
purge bool false reset and regenerate region
x number - target world x coordinate
y number - target world y coordinate
z number - target world z coordinate
player_x number 79 player horizontal coordinate
player_y number 29 player vertical coordinate

teleport

World.teleport(
optionstable--

settings (see warp)

) → ()

The same as warp but with the destination id implicitly being the current region

ascend

World.ascend() → ()

Increase the current Z coordinate by one, keeping the player position

descend

World.descend() → ()

Decrease the current Z coordinate by one, keeping the player position

origin

World.origin() → ()

Teleport to the origin of the current room

mirror_push

World.mirror_push(
valuestring--

mirror value

) → ()

Push a room mirror onto the stack

mirror_pop

World.mirror_pop() → ()

Pop a room mirror from the stack

template_get

World.template_get(
postable--

regional world coordinates (x, y, z)

) → TemplateRef

Get the template at the specified position.

template_find

World.template_find(
groupstring--

template group id

) → table--

position

Search for a position of the given template group

var_global

World.var_global(
keystring,--

variable path

optionstable | nil--

settings

) → GlobalRef

Retrieve a reference to a global variable

var_regional

World.var_regional(
keystring,--

variable path

optionstable | nil--

settings

) → GlobalRef

Retrieve a reference to a regional variable

Options

Name Type Default Description
id string Current Region of variable

var_local

World.var_local(
keystring,--

variable path

optionstable | nil--

settings

) → GlobalRef

Retrieve a reference to a local variable

Options

Name Type Default Description
id string Current Region of variable
x number Current World horizontal coordinate
y number Current World vertical coordinate
z number Current World depth coordinate

var_local_filter

World.var_local_filter(
optionstable--

settings

) → ()

Filter all local variables

Options

Name Type Default Description
start string - Name start with string filter
region string Current Region to filter

permanent_get

World.permanent_get(
keystring--

variable path

) → ()

Retrieve a permanent variable as string

permanent_set

World.permanent_set(
keystring,--

variable path

valuestring--

new value

) → ()

Set a permanent variable to a value

connector_check

World.connector_check(
connector_idstring--

connector identifier

) → boolean--

true if connector is set

Check if a given connector is set in the current room

entry_check

World.entry_check(
connector_idstring--

connector identifier

) → boolean--

true if entry is set

Check if a given connector is an entry in the current room

collision_set

World.collision_set(
xnumber,--

horizontal coordinate

ynumber,--

vertical coordinate

valueboolean--

value to set

) → ()

Set the collision value at the specified coordinates

collision_fill

World.collision_fill(
areatable,--

area data

valuenumber--

collision flag to set

) → ()

Fill the collision value in the specified area

collision_get

World.collision_get(
xnumber,--

horizontal coordinate

ynumber--

vertical coordinate

) → boolean--

collision flag

Get the collision value at the specified coordinates

collision_floor_set

World.collision_floor_set(
xnumber,--

horizontal coordinate

ynumber,--

vertical coordinate

valueboolean--

value to set

) → ()

Set the floor collision value at the specified coordinates

collision_floor_fill

World.collision_floor_fill(
areatable,--

area data

valuenumber--

collision flag to set

) → ()

Fill the collision value in the specified area

collision_floor_get

World.collision_floor_get(
xnumber,--

horizontal coordinate

ynumber--

vertical coordinate

) → boolean--

collision flag

Get the floor collision value at the specified coordinates

cell_set

World.cell_set(
xnumber,--

horizontal coordinate

ynumber,--

vertical coordinate

valuetable--

cell data

) → ()

Set a cell in the current room

Cell Data

Name Type Default Description
collision bool false Cell collision flag
char string - Cell character
fg table white Cell foreground color
bg table black Cell background color

cell_fill

World.cell_fill(
areatable,--

area data

valuetable--

cell data

) → ()

Fill an area with cell data in the current room

Area Data

Name Type Default Description
x1 number 0 Start x coordinate
y1 number 0 Start y coordinate
x2 number 0 End x coordinate
y2 number 0 End y coordinate
fill bool true Fill the area

Cell Data

Name Type Default Description
collision bool false Cell collision flag
char string - Cell character
fg table white Cell foreground color
bg table black Cell background color

cell_get

World.cell_get(
xnumber,--

horizontal coordinate

ynumber--

vertical coordinate

) → table--

cell data

Get the cell data of the current room at the specified coordinates

cell_overlay_set

World.cell_overlay_set(
xnumber,--

horizontal coordinate

ynumber,--

vertical coordinate

valuetable--

cell data

) → ()

Set an overlay cell in the current room

Cell Data

Name Type Default Description
char string - Cell character
fg table white Cell foreground color
bg table black Cell background color

cell_overlay_fill

World.cell_overlay_fill(
areatable,--

area data

valuetable--

cell data

) → ()

Fill an area with overlay cell data in the current room

Area Data

Name Type Default Description
x1 number 0 Start x coordinate
y1 number 0 Start y coordinate
x2 number 0 End x coordinate
y2 number 0 End y coordinate
fill bool true Fill the area

Cell Data

Name Type Default Description
char string - Cell character
fg table white Cell foreground color
bg table black Cell background color

cell_overlay_get

World.cell_overlay_get(
xnumber,--

horizontal coordinate

ynumber--

vertical coordinate

) → table--

cell data

Get the overlay cell data of the current room at the specified coordinates

entity_filter

World.entity_filter(
optionstable--

settings

) → ()

Remove entities based on the specified criteria

Options

Name Type Default Description
purge bool false Purge instead of kill
bullets bool false Select all bullets
enemies bool false Select all enemies
value string - Select value store id

Global

World.Global(
keystring,--

variable path

optionstable--

settings

) → ()

Shortcut for World.var_global

Regional

World.Regional(
keystring,--

variable path

optionstable--

settings

) → ()

Shortcut for World.var_regional

Local

World.Local(
keystring,--

variable path

optionstable--

settings

) → ()

Shortcut for World.var_local

Show raw api
{
    "functions": [
        {
            "name": "purge",
            "desc": "Purge a region from the global world state\n\n### Options\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| locals          | bool        |    true | purge locals from region       |\n| seed            | bool        |    true | purge seeds from region        |\n| doors           | bool        |    true | purge doors from region        |",
            "params": [
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 50,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "stage_advance",
            "desc": "Advances progression by one stage\n\nIncreases the stage level by one without adjusting the offset",
            "params": [],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 112,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "warp",
            "desc": "Sets the current room\n\n### Options\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| purge           | bool        |   false | reset and regenerate region    |\n| x               | number      |       - | target world x coordinate      |\n| y               | number      |       - | target world y coordinate      |\n| z               | number      |       - | target world z coordinate      |\n| player_x        | number      |      79 | player horizontal coordinate   |\n| player_y        | number      |      29 | player vertical coordinate     |",
            "params": [
                {
                    "name": "id",
                    "desc": "region identifier",
                    "lua_type": "string"
                },
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 160,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "teleport",
            "desc": "The same as warp but with the destination id implicitly being the current region",
            "params": [
                {
                    "name": "options",
                    "desc": "settings (see warp)",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 168,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "ascend",
            "desc": "Increase the current Z coordinate by one, keeping the player position",
            "params": [],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 175,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "descend",
            "desc": "Decrease the current Z coordinate by one, keeping the player position",
            "params": [],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 181,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "origin",
            "desc": "Teleport to the origin of the current room",
            "params": [],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 187,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "mirror_push",
            "desc": "Push a room mirror onto the stack",
            "params": [
                {
                    "name": "value",
                    "desc": "mirror value",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 269,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "mirror_pop",
            "desc": "Pop a room mirror from the stack",
            "params": [],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 276,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "template_get",
            "desc": "Get the template at the specified position.",
            "params": [
                {
                    "name": "pos",
                    "desc": "regional world coordinates (x, y, z)",
                    "lua_type": "table"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TemplateRef"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 291,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "template_find",
            "desc": "Search for a position of the given template group",
            "params": [
                {
                    "name": "group",
                    "desc": "template group id",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "position",
                    "lua_type": "table"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 301,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "var_global",
            "desc": "Retrieve a reference to a global variable",
            "params": [
                {
                    "name": "key",
                    "desc": "variable path",
                    "lua_type": "string"
                },
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table|nil"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "GlobalRef"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 312,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "var_regional",
            "desc": "Retrieve a reference to a regional variable\n\n### Options\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| id              | string      | Current | Region of variable             |",
            "params": [
                {
                    "name": "key",
                    "desc": "variable path",
                    "lua_type": "string"
                },
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table|nil"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "GlobalRef"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 328,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "var_local",
            "desc": "Retrieve a reference to a local variable\n\n### Options\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| id              | string      | Current | Region of variable             |\n| x               | number      | Current | World horizontal coordinate    |\n| y               | number      | Current | World vertical coordinate      |\n| z               | number      | Current | World depth coordinate         |",
            "params": [
                {
                    "name": "key",
                    "desc": "variable path",
                    "lua_type": "string"
                },
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table|nil"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "GlobalRef"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 347,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "var_local_filter",
            "desc": "Filter all local variables\n\n### Options\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| start           | string      |       - | Name start with string filter  |\n| region          | string      | Current | Region to filter               |",
            "params": [
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 362,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "permanent_get",
            "desc": "Retrieve a permanent variable as string",
            "params": [
                {
                    "name": "key",
                    "desc": "variable path",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 370,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "permanent_set",
            "desc": "Set a permanent variable to a value",
            "params": [
                {
                    "name": "key",
                    "desc": "variable path",
                    "lua_type": "string"
                },
                {
                    "name": "value",
                    "desc": "new value",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 379,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "connector_check",
            "desc": "Check if a given connector is set in the current room",
            "params": [
                {
                    "name": "connector_id",
                    "desc": "connector identifier",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "true if connector is set",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 409,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "entry_check",
            "desc": "Check if a given connector is an entry in the current room",
            "params": [
                {
                    "name": "connector_id",
                    "desc": "connector identifier",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "true if entry is set",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 419,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "collision_set",
            "desc": "Set the collision value at the specified coordinates",
            "params": [
                {
                    "name": "x",
                    "desc": "horizontal coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "y",
                    "desc": "vertical coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "value",
                    "desc": "value to set",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 430,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "collision_fill",
            "desc": "Fill the collision value in the specified area",
            "params": [
                {
                    "name": "area",
                    "desc": "area data",
                    "lua_type": "table"
                },
                {
                    "name": "value",
                    "desc": "collision flag to set",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 439,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "collision_get",
            "desc": "Get the collision value at the specified coordinates",
            "params": [
                {
                    "name": "x",
                    "desc": "horizontal coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "y",
                    "desc": "vertical coordinate",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "collision flag",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 449,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "collision_floor_set",
            "desc": "Set the floor collision value at the specified coordinates",
            "params": [
                {
                    "name": "x",
                    "desc": "horizontal coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "y",
                    "desc": "vertical coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "value",
                    "desc": "value to set",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 460,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "collision_floor_fill",
            "desc": "Fill the collision value in the specified area",
            "params": [
                {
                    "name": "area",
                    "desc": "area data",
                    "lua_type": "table"
                },
                {
                    "name": "value",
                    "desc": "collision flag to set",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 469,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "collision_floor_get",
            "desc": "Get the floor collision value at the specified coordinates",
            "params": [
                {
                    "name": "x",
                    "desc": "horizontal coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "y",
                    "desc": "vertical coordinate",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "collision flag",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 479,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "cell_set",
            "desc": "Set a cell in the current room\n\n### Cell Data\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| collision       | bool        |   false | Cell collision flag            |\n| char            | string      |       - | Cell character                 |\n| fg              | table       |   white | Cell foreground color          |\n| bg              | table       |   black | Cell background color          |",
            "params": [
                {
                    "name": "x",
                    "desc": "horizontal coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "y",
                    "desc": "vertical coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "value",
                    "desc": "cell data",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 498,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "cell_fill",
            "desc": "Fill an area with cell data in the current room\n\n### Area Data\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| x1              | number      |       0 | Start x coordinate             |\n| y1              | number      |       0 | Start y coordinate             |\n| x2              | number      |       0 | End x coordinate               |\n| y2              | number      |       0 | End y coordinate               |\n| fill            | bool        |    true | Fill the area                  |\n\n### Cell Data\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| collision       | bool        |   false | Cell collision flag            |\n| char            | string      |       - | Cell character                 |\n| fg              | table       |   white | Cell foreground color          |\n| bg              | table       |   black | Cell background color          |",
            "params": [
                {
                    "name": "area",
                    "desc": "area data",
                    "lua_type": "table"
                },
                {
                    "name": "value",
                    "desc": "cell data",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 524,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "cell_get",
            "desc": "Get the cell data of the current room at the specified coordinates",
            "params": [
                {
                    "name": "x",
                    "desc": "horizontal coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "y",
                    "desc": "vertical coordinate",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "cell data",
                    "lua_type": "table"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 534,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "cell_overlay_set",
            "desc": "Set an overlay cell in the current room\n\n### Cell Data\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| char            | string      |       - | Cell character                 |\n| fg              | table       |   white | Cell foreground color          |\n| bg              | table       |   black | Cell background color          |",
            "params": [
                {
                    "name": "x",
                    "desc": "horizontal coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "y",
                    "desc": "vertical coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "value",
                    "desc": "cell data",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 552,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "cell_overlay_fill",
            "desc": "Fill an area with overlay cell data in the current room\n\n### Area Data\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| x1              | number      |       0 | Start x coordinate             |\n| y1              | number      |       0 | Start y coordinate             |\n| x2              | number      |       0 | End x coordinate               |\n| y2              | number      |       0 | End y coordinate               |\n| fill            | bool        |    true | Fill the area                  |\n\n### Cell Data\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| char            | string      |       - | Cell character                 |\n| fg              | table       |   white | Cell foreground color          |\n| bg              | table       |   black | Cell background color          |",
            "params": [
                {
                    "name": "area",
                    "desc": "area data",
                    "lua_type": "table"
                },
                {
                    "name": "value",
                    "desc": "cell data",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 577,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "cell_overlay_get",
            "desc": "Get the overlay cell data of the current room at the specified coordinates",
            "params": [
                {
                    "name": "x",
                    "desc": "horizontal coordinate",
                    "lua_type": "number"
                },
                {
                    "name": "y",
                    "desc": "vertical coordinate",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "cell data",
                    "lua_type": "table"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 587,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "entity_filter",
            "desc": "Remove entities based on the specified criteria\n\n### Options\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| purge           | bool        |   false | Purge instead of kill          |\n| bullets         | bool        |   false | Select all bullets             |\n| enemies         | bool        |   false | Select all enemies             |\n| value           | string      |       - | Select value store id          |",
            "params": [
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 604,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "Global",
            "desc": "Shortcut for `World.var_global`",
            "params": [
                {
                    "name": "key",
                    "desc": "variable path",
                    "lua_type": "string"
                },
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 24,
                "path": "../../res/data/script/lib/init.lua"
            }
        },
        {
            "name": "Regional",
            "desc": "Shortcut for `World.var_regional`",
            "params": [
                {
                    "name": "key",
                    "desc": "variable path",
                    "lua_type": "string"
                },
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 34,
                "path": "../../res/data/script/lib/init.lua"
            }
        },
        {
            "name": "Local",
            "desc": "Shortcut for `World.var_local`",
            "params": [
                {
                    "name": "key",
                    "desc": "variable path",
                    "lua_type": "string"
                },
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 44,
                "path": "../../res/data/script/lib/init.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "id",
            "desc": "Get/Set the world identifier (e.g. \"forest\")",
            "lua_type": "string",
            "source": {
                "line": 16,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "id_change",
            "desc": "Get the flag marking a world id change since the last room change",
            "lua_type": "boolean",
            "source": {
                "line": 23,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "shift_applied",
            "desc": "Get the flag marking last room change was a shift",
            "lua_type": "boolean",
            "source": {
                "line": 30,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "shift_disable",
            "desc": "Get/Set the flag disabling the player shifting between rooms",
            "lua_type": "boolean",
            "source": {
                "line": 37,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "pos",
            "desc": "Get/Set the world position (x/y/z)",
            "lua_type": "table",
            "source": {
                "line": 59,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "x",
            "desc": "Get/Set the world x coordinate",
            "lua_type": "number",
            "source": {
                "line": 66,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "y",
            "desc": "Get/Set the world y coordinate",
            "lua_type": "number",
            "source": {
                "line": 73,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "z",
            "desc": "Get/Set the world z coordinate",
            "lua_type": "number",
            "source": {
                "line": 80,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "seed",
            "desc": "Get the global world seed",
            "lua_type": "number",
            "source": {
                "line": 87,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "seed_room",
            "desc": "Get the room seed (current x, y, z)\n\nThe room seed is based on the world and regional seed",
            "lua_type": "number",
            "source": {
                "line": 96,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "seed_region",
            "desc": "Get the region seed (current id)\n\nThe regional seed may change on a regional reset",
            "lua_type": "number",
            "source": {
                "line": 105,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "stage_level",
            "desc": "Get/Set the global stage level.",
            "lua_type": "number",
            "source": {
                "line": 120,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "dungeon_level",
            "desc": "Get/Set the global dungeon level.",
            "lua_type": "number",
            "source": {
                "line": 127,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "music_level",
            "desc": "Get/Set the global music level.",
            "lua_type": "number",
            "source": {
                "line": 134,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "fog_intensity",
            "desc": "You can use a shader instead.",
            "lua_type": "number",
            "tags": [
                "deprecated"
            ],
            "source": {
                "line": 143,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "gravity",
            "desc": "Get/Set the current gravity",
            "lua_type": "table",
            "source": {
                "line": 195,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "gravity_x",
            "desc": "Get/Set the current horizontal gravity",
            "lua_type": "number",
            "source": {
                "line": 202,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "gravity_y",
            "desc": "Get/Set the current vertical gravity",
            "lua_type": "number",
            "source": {
                "line": 209,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "difficulty",
            "desc": "Get the current difficulty",
            "lua_type": "DifficultyRef",
            "source": {
                "line": 216,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "mode",
            "desc": "Get/Set the current mode",
            "lua_type": "string",
            "source": {
                "line": 222,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "mode_play",
            "desc": "Get/Set the current play mode\n\n### Play Modes\n| Value           |\n|-----------------|\n| Rogue           |\n| Adventure       |",
            "lua_type": "string",
            "source": {
                "line": 235,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "mode_life",
            "desc": "Get/Set the current life mode\n\n### Life Modes\n| Value           | Description             |\n|-----------------|-------------------------|\n| Reset           | Reset in room on death  |\n| Health          | Death when health is 0  |",
            "lua_type": "string",
            "source": {
                "line": 248,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "mirror",
            "desc": "Get the current room mirror\n\n### Mirrors\n| Value           | Description             |\n|-----------------|-------------------------|\n| empty           | no mirror               |\n| I               | horizontal mirror       |\n| -               | vertical mirror         |\n| X               | point mirror            |",
            "lua_type": "string",
            "source": {
                "line": 263,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "template",
            "desc": "Get the template at the current position.",
            "lua_type": "TemplateRef",
            "source": {
                "line": 284,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "elapsed",
            "desc": "Get the elapsed seconds of the world simulation",
            "lua_type": "number",
            "source": {
                "line": 388,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "elapsed_room",
            "desc": "Get the elapsed seconds of the world simulation since entering the room",
            "lua_type": "number",
            "source": {
                "line": 395,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        },
        {
            "name": "elapsed_visual",
            "desc": "Get the elapsed seconds of the visual world simulation",
            "lua_type": "number",
            "source": {
                "line": 402,
                "path": "../../res/data/script/lib/system/world.lua"
            }
        }
    ],
    "types": [],
    "name": "World",
    "desc": "The world interface\n\n```lua\n```",
    "source": {
        "line": 8,
        "path": "../../res/data/script/lib/system/world.lua"
    }
}