CorsixTH Lua Documentation

World Class

Manages entities, rooms, and the date.

Declared on: line 48 of Lua/world.lua.

Method Index

Member Index

function World:World(app, free_build_mode)

Parameters:

NameTypeDescription
app ? ?
free_build_mode ? ?

Declared on: line 54 of Lua/world.lua.

function World:_createMapObject(object)

Internal function for placing an object from the map file.

Parameters:

NameTypeDescription
object ? Object to place.

Declared on: line 567 of Lua/world.lua.

function World:_executeAutosave()

Creates a save file in the "Autosaves" folder, using the "Autosave-mm-dd.sav" name template for filename. If the "Autosaves" folder does not exist, folder will be created.

Declared on: line 1000 of Lua/world.lua.

function World:_findClosestSpawnToDesk(staffed_desks, spawns)

Private function to assess the shortest path between all spawn points and desks

Parameters:

NameTypeDescription
staffed_desks table All staffed reception desks
spawns table All available spawn points

Declared on: line 397 of Lua/world.lua.

function World:_flushDestroyedEntities()

Entities are queued by World:destroyEntity while iterating over

self.entities, so this must only be called once that iteration finished.

Declared on: line 1858 of Lua/world.lua.

function World:_generateNextVipDate()

PRIVATE method to generate the next VIP date Note: it is important we ensure this date always is in the future

Declared on: line 1319 of Lua/world.lua.

function World:_prepareSpawnDates(first_game_month)

Called when a month ends. Decides on which dates patients arrive during the coming month.

Parameters:

NameTypeDescription
first_game_month bool Is that the very first date distribution at the level TODO: Requires adjustment for AIHospital spawns; see PR 1986 for progress.

Declared on: line 1177 of Lua/world.lua.

function World:addObjectToTile(object, x, y)

Notify the world of a new object being placed somewhere in the world

See also `World:removeObjectFromTile`

Parameters:

NameTypeDescription
object Object The object being placed
x integer The X-coordinate of the tile being placed upon
y integer The Y-coordinate of the tile being placed upon

Declared on: line 2290 of Lua/world.lua.

function World:adjustZoom(delta)

Adjust the current zoom level by a delta TODO: This should live in game_ui not world

Parameters:

NameTypeDescription
delta ? ?

Declared on: line 188 of Lua/world.lua.

function World:afterLoad(old, new)

Let the world react to and old save game. First it gets the chance to do things for itself, and then it calls corresponding functions for the hospitals, entities and rooms in that order.

Parameters:

NameTypeDescription
old integer The old version of the save game.
new integer The current version of the save game format.

Declared on: line 2547 of Lua/world.lua.

function World:anyHumanoidObscuringArea(x, y)

Сhecks whether a tile is occupied by any humanoid.

Parameters:

NameTypeDescription
x integer the queried tile's x coordinate.
y integer the queried tile's y coordinate.

Declared on: line 1559 of Lua/world.lua.

function World:applyLevelStartPrices()

Apply level-defined pricing to all available diseases.

Declared on: line 264 of Lua/world.lua.

function World:atLeastOneHumanoidLocatedAtTile(x, y)

Checks if any humanoid is located on a tile.

Parameters:

NameTypeDescription
x integer the queried tile's x coordinate.
y integer the queried tile's y coordinate.

Declared on: line 1551 of Lua/world.lua.

function World:atLeastOneObjectLocatedAtTile(x, y)

Checks if any object is located on a tile.

Parameters:

NameTypeDescription
x integer the queried tile's x coordinate.
y integer the queried tile's y coordinate.

Declared on: line 1543 of Lua/world.lua.

function World:calculateSpawnTiles()

Identify the tiles on the map suitable for spawning `Humanoid`s from.

Declared on: line 331 of Lua/world.lua.

function World:canNonSideObjectBeSpawnedAt(x, y, objects_id, orientation, spawn_rooms_id, player_id)

Checks whether object can be spawned at some coordinates. For example, when searching for a suitable placement for "gates_to_hell". 'NonSideObject' is a object that do occupy the tile entirely, not only one side of it.

Parameters:

NameTypeDescription
x ? ?
y ? ?
objects_id ? ?
orientation ? ?
spawn_rooms_id ? ?
player_id ? ?

Declared on: line 1909 of Lua/world.lua.

function World:chooseHospitalForPatient(disease)

Choose hospital for normal patient

Parameters:

NameTypeDescription
disease table - the disease assigned to this patient

Declared on: line 3112 of Lua/world.lua.

function World:clearCaches()

Clear all internal caches which are dependent upon map state / object position

Declared on: line 662 of Lua/world.lua.

function World:computeNextEmergencyDates(emergency)

Generate the dates for the next emergency

Parameters:

NameTypeDescription
emergency ? The next scheduled emergency to take place

Declared on: line 1292 of Lua/world.lua.

function World:createMapObjects(objects)

Place objects from a map file onto the map.

Parameters:

NameTypeDescription
objects ? Objects to place.

Declared on: line 556 of Lua/world.lua.

function World:date()

Get todays date.

Declared on: line 3052 of Lua/world.lua.

function World:debugDisableSalaryRaise(mode)

Enable or disable salary raise events.

Parameters:

NameTypeDescription
mode boolean If true, do not create salary raise events.

Declared on: line 501 of Lua/world.lua.

function World:destroyEntity(entity)

Parameters:

NameTypeDescription
entity ? ?

Declared on: line 1835 of Lua/world.lua.

function World:determineWinningConditions()

In EndConditions, collect and test the win and lose conditions of the level.

Declared on: line 281 of Lua/world.lua.

function World:dumpGameLog()

Dump the contents of the game log into a file. This is automatically done on each error.

Declared on: line 2482 of Lua/world.lua.

function World:findAllObjectsNear(x, y, distance, object_type_name)

Returns a set of all objects near the given position but if supplied only of the given object type.

Parameters:

NameTypeDescription
x ? The x-coordinate at which to originate the search
y ? The y-coordinate
distance ? The number of tiles away from the origin to search
object_type_name ? The name of the objects that are being searched for

Declared on: line 1611 of Lua/world.lua.

function World:findFreeObjectNearToUse(humanoid, object_type_name, which, current_object)

Parameters:

NameTypeDescription
humanoid ? ?
object_type_name ? ?
which ? ?
current_object ? ?

Declared on: line 1707 of Lua/world.lua.

function World:findObjectNear(humanoid, object_type_name, distance, only_usable, callback)

Find all objects of the given type near the humanoid. Note that regardless of distance, only the room which the humanoid is in is searched (or the corridor if the humanoid is not in a room). When no callback is specified then the first object found is returned, along with its usage tile position. This may return an object already being used - if you want to find an object not in use (in order to use it), then call findFreeObjectNearToUse instead.

Parameters:

NameTypeDescription
humanoid ? The humanoid to search around
object_type_name ? The objects to search for
distance ? Maximum L1 distance to search from humanoid. If nil then everywhere in range will be searched.
only_usable ? Bool If true the object must be permitted for use
callback ? Function to call for each result. If it returns true then the search will be ended. --

Declared on: line 1642 of Lua/world.lua.

function World:findRoomNear(humanoid, room_type_id, max_distance, mode)

Finds the most desirable room of a given room type for the provided humanoid.

"advanced" prefers a near room but also takes into account queue size/staffing

Parameters:

NameTypeDescription
humanoid ? The queried NPC (start point)
room_type_id string The room we are looking for
max_distance number The maximum distance away a room will be considered from the humanoid
mode string "nearest"/nil returns the nearest room, while

Declared on: line 1747 of Lua/world.lua.

function World:gameLog(message)

Append a message to the game log.

Parameters:

NameTypeDescription
message string The message to add.

Declared on: line 2472 of Lua/world.lua.

function World:getAvailableRooms()

Find the rooms available at the level.

Declared on: line 287 of Lua/world.lua.

function World:getCampaignData()

Collect the settings that should be reused in the next world

Declared on: line 3058 of Lua/world.lua.

function World:getCampaignWinningText(player_no)

the "continue"-choice the player has, and whether it is the "return_to_main_menu"

choice or the "accept_new_level" choice.

Parameters:

NameTypeDescription
player_no integer Which player that will see the message.

Declared on: line 1374 of Lua/world.lua.

function World:getCurrentSpeed()

Return the name of the current speed, relating to a key in tick_rates.

Declared on: line 748 of Lua/world.lua.

function World:getFreeBench(x, y, distance)

Parameters:

NameTypeDescription
x ? ?
y ? ?
distance ? ?

Declared on: line 1574 of Lua/world.lua.

function World:getHospital(x, y)

Get the hospital at a given tile location.

Parameters:

NameTypeDescription
x int X position of the queried tile.
y int Y position of the queried tile.

Declared on: line 2424 of Lua/world.lua.

function World:getIdleTile(x, y, idx, parcel_id)

Find an tile for idling.

Parameters:

NameTypeDescription
x ? X coordinate of the queue position.
y ? Y coordinate of the queue position.
idx ? Randomization factor for the idle tile, returns Nth candidate tile.
parcel_id ? Optional parcel of the indoor returned idling tile.

Declared on: line 1497 of Lua/world.lua.

function World:getLocalPlayerHospital()

Get the hospital controlled by the (single) player.

Declared on: line 323 of Lua/world.lua.

function World:getNewPatientDisease()

Find a valid disease that a patient can use

Declared on: line 3090 of Lua/world.lua.

function World:getObject(x, y, id, only_usable)

Retrieve one object from a given position.

that id, set of strings gets first object that matches an entry in the set.

Parameters:

NameTypeDescription
x int X position of the object to retrieve.
y int Y position of the object to retrieve.
id ? Id to search, nil gets first object, string gets first object with
only_usable bool If true the object must be permitted for use

Declared on: line 2318 of Lua/world.lua.

function World:getObjectToNotifyOfOccupants(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

Declared on: line 551 of Lua/world.lua.

function World:getObjects(x, y)

Retrieve all objects from a given position.

Parameters:

NameTypeDescription
x int X position of the object to retrieve.
y int Y position of the object to retrieve.

Declared on: line 2310 of Lua/world.lua.

function World:getPath(x, y, dest_x, dest_y)

Parameters:

NameTypeDescription
x ? ?
y ? ?
dest_x ? ?
dest_y ? ?

Declared on: line 1493 of Lua/world.lua.

function World:getPathDistance(x1, y1, x2, y2)

Calculate the distance of the shortest path (along passable tiles) between the two given map tiles. This operation is commutative (swapping (x1, y1) with (x2, y2) has no effect on the result) if both tiles are passable.

Parameters:

NameTypeDescription
x1 integer X-cordinate of first tile's Lua tile coordinates.
y1 integer Y-cordinate of first tile's Lua tile coordinates.
x2 integer X-cordinate of second tile's Lua tile coordinates.
y2 integer Y-cordinate of second tile's Lua tile coordinates.

Declared on: line 1480 of Lua/world.lua.

function World:getPlayerMachines()

Gets a list of all the machines in the player's hospital.

Declared on: line 2454 of Lua/world.lua.

function World:getRoom(x, y)

Get the room at a given tile location.

Parameters:

NameTypeDescription
x int X position of the queried tile.
y int Y position of the queried tile.

Declared on: line 2416 of Lua/world.lua.

function World:getRoomNameAndRequiredStaffName(room_id)

Returns localized name of the room, internal required staff name and localized name of staff required.

Parameters:

NameTypeDescription
room_id ? ?

Declared on: line 2436 of Lua/world.lua.

function World:getWallDirFromBlockId(block_id)

Parameters:

NameTypeDescription
block_id ? ?

Declared on: line 710 of Lua/world.lua.

function World:getWallIdFromBlockId(block_id)

Parameters:

NameTypeDescription
block_id ? ?

Declared on: line 694 of Lua/world.lua.

function World:getWallSetFromBlockId(block_id)

Parameters:

NameTypeDescription
block_id ? ?

Declared on: line 702 of Lua/world.lua.

function World:initLevel(app, avail_rooms)

Initialize the game level (available diseases, winning conditions).

Parameters:

NameTypeDescription
app ? Game application.
avail_rooms list Available rooms in the level.

Declared on: line 214 of Lua/world.lua.

function World:isCampaign()

Returns whether the level being played is part of a campaign or not

Declared on: line 3159 of Lua/world.lua.

function World:isCurrentSpeed(speed)

Return true if the given speed the same as the current speed.

Parameters:

NameTypeDescription
speed ? ?

Declared on: line 742 of Lua/world.lua.

function World:isFootprintTileBuildableOrPassable(x, y, tile, footprint, requirement_flag, player_id)

- A footprint tile will either need to be buildable or passable so this function checks if its buildable/passable using the tile's appropriate flag and then returns this flag's boolean value or false if the tile isn't valid. -

Parameters:

NameTypeDescription
x ? ?
y ? ?
tile ? ?
footprint ? ?
requirement_flag ? ?
player_id ? ?

Declared on: line 1967 of Lua/world.lua.

function World:isGameUserPaused()

Check whether user pause state applies

Declared on: line 851 of Lua/world.lua.

function World:isMustPauseActive()

Check if "Must Pause" mode enabled

Declared on: line 833 of Lua/world.lua.

function World:isNearRat(x, y)

Determine if any rat is near the given screen coordinates (relative to the map origin). Compares against each nearby rat's drawn pixel position rather than the tile it is anchored to, which can be up to a tile away while it scurries.

Parameters:

NameTypeDescription
x number x-coordinate on the screen
y number y-coordinate on the screen

Declared on: line 3168 of Lua/world.lua.

function World:isOnMap(x, y)

Test whether the given coordinate is on the map.

Parameters:

NameTypeDescription
x int X position of the coordinate to test.
y int Y position of the coordinate to test.

Declared on: line 1933 of Lua/world.lua.

function World:isPaused()

Check if game is currently paused

Declared on: line 839 of Lua/world.lua.

function World:isTileEmpty(x, y, not_in_room)

This function checks if a tile has no entity on it and (optionally) if it is not in a room.

Parameters:

NameTypeDescription
x integer the queried tile's x coordinate.
y integer the queried tile's y coordinate.
not_in_room boolean If set, also check the tile is not in a room.

Declared on: line 1524 of Lua/world.lua.

function World:isTileExclusivelyPassable(x, y, distance)

When placing doors and objects the passable tiles need to be checked for overlapping passable tiles. This presents problems with objects like Bench where the passable tile is not for exclusive use of the Bench (another object can share that same tile) the footprint.shareable differentiates shareable passable tiles, and exclusive use passable tiles (the norm for most objects)

Parameters:

NameTypeDescription
x int x map tile position
y int y map tile position
distance int searchable distance for nearby objects

Declared on: line 3022 of Lua/world.lua.

function World:isTilePartOfNearbyObject(x, y, distance)

Checks whether the given tile is part of a nearby object (walkable tiles count as part of the object)

Parameters:

NameTypeDescription
x ? X position of the given tile.
y ? Y position of the given tile.
distance ? The number of tiles away from the tile to search.

Declared on: line 1594 of Lua/world.lua.

function World:isUserActionProhibited()

Function to check if player can perform actions when paused

Declared on: line 881 of Lua/world.lua.

function World:localiseInitial(profile)

Change the staff name first letter to one from the current language from the seed (generated here or in staff_profile.lua)

Parameters:

NameTypeDescription
profile table The profile of the staff member

Declared on: line 2533 of Lua/world.lua.

function World:loseGame(player_no, reason, limit)

Cause the player with the player number player_no to lose.

Parameters:

NameTypeDescription
player_no number The number of the player which should lose.
reason string [optional] The name of the criterion the player lost to.
limit number [optional] The number the player went over/under which caused him to lose.

Declared on: line 1443 of Lua/world.lua.

function World:makeAvailableStaff(month)

Parameters:

NameTypeDescription
month ? ?

Declared on: line 513 of Lua/world.lua.

function World:markRoomAsBuilt(room)

Called when a room has been completely built and is ready to use.

Parameters:

NameTypeDescription
room Room The new room.

Declared on: line 638 of Lua/world.lua.

function World:mustPauseWindowAdd()

Called when a must pause window comes into existence and pauses the game

Declared on: line 813 of Lua/world.lua.

function World:mustPauseWindowRemoved()

Called when a must pause window is closed and will attempt to unpause

the game

Declared on: line 819 of Lua/world.lua.

function World:newEntity(class, animation, mood_marker)

Create a new entity.

Parameters:

NameTypeDescription
class ? Class to use for the new entity.
animation int animation to use.
mood_marker int Whether to use the first (default), or the second marker.

Declared on: line 1816 of Lua/world.lua.

function World:newFloatingDollarSign(patient, amount)

Setup an animated floating money amount above a patient.

Parameters:

NameTypeDescription
patient ? Patient to float above.
amount ? Amount of money to display.

Declared on: line 1787 of Lua/world.lua.

function World:newLitter(litter_type, x, y, mirror)

Create a piece of litter on a tile, respecting the rank of any litter

already on that tile.

Parameters:

NameTypeDescription
litter_type string or or or int Type passed on to Litter:setLitterType.
x int X position of the tile.
y int Y position of the tile.
mirror int Mirror flag passed on to Litter:setLitterType.

Declared on: line 2365 of Lua/world.lua.

function World:newObject(id, x, y, flags, name)

Creates a new object by finding the object_type from the "id" variable and calls its class constructor.

Parameters:

NameTypeDescription
id string The unique id of the object to be created.
x ? X position of the new object.
y ? Y position of the new object.
flags ? Flags of the new object.
name ? Name of the new object.

Declared on: line 1881 of Lua/world.lua.

function World:newObjectType(new_object)

Parameters:

NameTypeDescription
new_object ? ?

Declared on: line 1877 of Lua/world.lua.

function World:newRoom(x, y, w, h, room_info, ...)

Parameters:

NameTypeDescription
x ? ?
y ? ?
w ? ?
h ? ?
room_info ? ?
... ? ?

Declared on: line 625 of Lua/world.lua.

function World:nextEmergency()

Called when it is time to determine when the next emergency should happen

Declared on: line 1240 of Lua/world.lua.

function World:nextVip()

Called when it is time to have another VIP

Declared on: line 1314 of Lua/world.lua.

function World:notifyObjectOfOccupants(x, y, object)

Register a callback for when `Humanoid`s enter or leave a given tile.

Note that only one callback may be registered to each tile.

Parameters:

NameTypeDescription
x integer The 1-based X coordinate of the tile to monitor.
y integer The 1-based Y coordinate of the tile to monitor.
object Object Something with an `onOccupantChange` method, which will be called whenever a `Humanoid` enters or leaves the given tile. The method will receive one argument (after `self`), which will be `1` for an enter event and `-1` for a leave event.

Declared on: line 537 of Lua/world.lua.

function World:notifyRoomRemoved(room)

Called when a room has been deactivated (crashed or edited)

Parameters:

NameTypeDescription
room ? ?

Declared on: line 654 of Lua/world.lua.

function World:objectPlaced(entity, id)

Notifies the world that an object has been placed, notifying interested entities in the vicinity of the new arrival.

Parameters:

NameTypeDescription
entity Entity The entity that was just placed.
id optional or string That entity's id.

Declared on: line 2246 of Lua/world.lua.

function World:onEndDay()

Called immediately prior to the ingame day changing.

Declared on: line 1052 of Lua/world.lua.

function World:onEndMonth()

Called immediately prior to the ingame month changing. returns true if the game was killed due to the player losing

Declared on: line 1149 of Lua/world.lua.

function World:onEndYear()

Called immediately prior to the ingame year changing.

Declared on: line 1461 of Lua/world.lua.

function World:onTick()

World ticks (every 18ms) are translated to game ticks (or hours) depending on the current speed of the game. There are 50 hours in a TH day.

Declared on: line 907 of Lua/world.lua.

function World:pauseOrUnpause()

Dedicated function to allow unpausing by pressing 'p' again

Declared on: line 869 of Lua/world.lua.

function World:prepareFootprintTilesForBuild(object_footprint, x, y)

Prepare all tiles of the footprint for build of an object.

Parameters:

NameTypeDescription
object_footprint ? Footprint of the object being build.
x int X position of the object
y int Y position of the object

Declared on: line 2383 of Lua/world.lua.

function World:prepareRectangleTilesForBuild(x, y, w, h)

Prepare all tiles in the given rectangle for building a room.

Parameters:

NameTypeDescription
x int Start x position of the area.
y int Start y position of the area.
w int Number of tiles in x direction.
h int Number of tiles in y direction.

Declared on: line 2398 of Lua/world.lua.

function World:registerRoomRemoveCallback(callback)

Register a function to be called whenever a room has been deactivated (crashed or edited).

Parameters:

NameTypeDescription
callback function A function taking one argument: a `Room`.

Declared on: line 612 of Lua/world.lua.

function World:removeAllLitter(x, y)

Remove all cleanable litter from a given tile.

Parameters:

NameTypeDescription
x int X position of the tile to clean.
y int Y position of the tile to clean.

Declared on: line 2349 of Lua/world.lua.

function World:removeObjectFromTile(object, x, y)

Notify the world of an object being removed from a tile

See also `World:addObjectToTile`

Parameters:

NameTypeDescription
object Object The object being removed.
x integer The X-coordinate of the tile which the object was on
y integer The Y-coordinate of the tile which the object was on

Declared on: line 2268 of Lua/world.lua.

function World:resetAnimations()

Because the save file only saves one thob per tile if they are more that information will be lost. To solve this after a load we need to set again all the thobs on each tile.

Declared on: line 2496 of Lua/world.lua.

function World:resetSideObjects()

There is a problem with room editing in that it resets all the partial passable flags (travelNorth, travelSouth etc.) in the corridor, a workaround is calling this function after the room was edited so that all edge only objects, that set partial passable flags set those flags again

Declared on: line 3008 of Lua/world.lua.

function World:scheduleRandomEmergency(control)

If a level file specifies random emergencies we make the next one as defined by the mean/variance given

Parameters:

NameTypeDescription
control table Contains emergency information from level file

Declared on: line 1275 of Lua/world.lua.

function World:setCampaignData(campaign_data)

Restore the settings from the previous world

Parameters:

NameTypeDescription
campaign_data table world and hospital campaign data

Declared on: line 3069 of Lua/world.lua.

function World:setEndMonth()

Change the date of the game to the last hour of this month.

Declared on: line 1020 of Lua/world.lua.

function World:setEndYear()

Change the date of the game to the last hour of this year.

Declared on: line 1031 of Lua/world.lua.

function World:setPlotOwner(parcel, owner)

Change owner of a plot.

Parameters:

NameTypeDescription
parcel int Plot to change.
owner int New owner (may be 0).

Declared on: line 596 of Lua/world.lua.

function World:setSpeed(new_speed)

Set the (approximate) number of seconds per tick.

Parameters:

NameTypeDescription
new_speed string New speed to set. One of: "Pause", "Slowest", "Slower", "Normal", "Max speed", or "And then some more".

Declared on: line 766 of Lua/world.lua.

function World:setUI(ui)

Register key shortcuts for controlling the world (game speed, etc.)

Parameters:

NameTypeDescription
ui ? ?

Declared on: line 170 of Lua/world.lua.

function World:setUserPaused(state)

Update state of if game has been paused by user

Parameters:

NameTypeDescription
state boolean

Declared on: line 845 of Lua/world.lua.

function World:setUserSpeed(new_speed)

Set game speed from a user-facing control.

Parameters:

NameTypeDescription
new_speed string New speed to set.

Declared on: line 757 of Lua/world.lua.

function World:spawnPatient(hospital)

Spawn a patient from a spawn point for the given hospital.

Parameters:

NameTypeDescription
hospital Hospital Hospital that the new patient should visit.

Declared on: line 428 of Lua/world.lua.

function World:spawnVIP(name)

A VIP is invited (or he invited himself) to the player hospital.

Parameters:

NameTypeDescription
name ? Name of the VIP

Declared on: line 474 of Lua/world.lua.

function World:unregisterRoomRemoveCallback(callback)

Unregister a function from being called whenever a room has been deactivated (crashed or edited).

Parameters:

NameTypeDescription
callback function A function previously passed to `registerRoomRemoveCallback`.

Declared on: line 618 of Lua/world.lua.

function World:updateInitialsCache()

Refresh cache of letters in current language to be used for staff member's initials

Declared on: line 2521 of Lua/world.lua.

function World:updateScreenBlueFilter()

Set the blue filter according to whether the user can build or not.

Declared on: line 864 of Lua/world.lua.

function World:updateUserActionsAllowed()

Set the "actions allowed" flag according to whether the user can do some actions with UI or not.

Declared on: line 857 of Lua/world.lua.

function World:updateUserInteractionState()

Refresh whether the user can interact with the game and presence of the blue filter

Declared on: line 806 of Lua/world.lua.

function World:validateMap()

Perform validity tests on the map in world

Declared on: line 3078 of Lua/world.lua.

function World:wasEmergencySkipped(prev_date, new_date)

Checks if a time jump caused an emergency to be missed

Parameters:

NameTypeDescription
prev_date Date Original game date before jump
new_date Date Game date after time jump

Declared on: line 1042 of Lua/world.lua.

function World:willObjectsFootprintTileBeWithinItsAllowedRoomIfLocatedAt(x, y, object, allowed_rooms_id_parameter)

- @param allowed_rooms_id_parameter Should be nil when the object is allowed to be placed in any room. @return {within_room, roomId} -

Parameters:

NameTypeDescription
x ? ?
y ? ?
object ? ?
allowed_rooms_id_parameter ? ?

Declared on: line 1941 of Lua/world.lua.

function World:winGame(player_no)

Process that the given player number won the game.

Parameters:

NameTypeDescription
player_no integer Number of the player who just won.

Declared on: line 1330 of Lua/world.lua.

function World:wouldNonSideObjectBreakPathfindingIfSpawnedAt(x, y, object, objects_orientation, room_id)

become when the object is placed), and then check that the cells

surrounding the footprint have not had their connectedness changed.

Parameters:

NameTypeDescription
x integer target tile x coordinate.
y integer target tile y coordinate.
object object target object for placing.
objects_orientation table object orientations description with footprints.
room_id integer target room for placing the object.

Declared on: line 2009 of Lua/world.lua.

function World:wouldNonSideObjectsNotHaveAccessToRoomDoor(object_x, object_y, room, object_layout)

become when the object is placed), and then check that the

"use_position" cells have path to the room door.

Parameters:

NameTypeDescription
object_x integer target tile x coordinate.
object_y integer target tile y coordinate.
room object target room for placing the object.
object_layout table object orientation description with footprint.

Declared on: line 2089 of Lua/world.lua.

function World:wouldObjectBreakRoomObjectsAccessToTheRoomDoor(object_x, object_y, room, object_layout, is_side_object)

And then this function check that the "use_position" cells

of existing objects have path to the room door.

Parameters:

NameTypeDescription
object_x integer target tile x coordinate.
object_y integer target tile y coordinate.
room object target room for placing the object.
object_layout table object orientation description with footprint.
is_side_object bool is that object is side object.

Declared on: line 2160 of Lua/world.lua.