industrial_lift
Vars | |
changed_gliders | lazy list of movables inside lift_load who had their glide_size changed since our last movement. used so that we dont have to change the glide_size of every object every movement, which scales to cost more than you'd think |
---|---|
create_multitile_platform | if TRUE, this platform will late initialize and then expand to become a multitile object across all other linked platforms on this z level |
glide_size_override | what glide_size we set our moving contents to. |
height | how many tiles this platform extends on the y axis (north-south not up-down, that would be the z axis) |
initial_contents | lazylist of weakrefs to the contents we have when we're first created. stored so that admins can clear the tram to its initial state if someone put a bunch of stuff onto it. |
lift_id | ID used to determine what lift types we can merge with |
lift_load | what movables on our platform that we are moving |
lift_master_datum | master datum that controls our movement. in general /industrial_lift subtypes control moving themselves, and /datum/lift_master instances control moving the entire tram and any behavior associated with that. |
lift_master_type | what subtype of /datum/lift_master to create for itself if no other platform on this tram has created one yet. very important for some behaviors since |
pass_through_floors | if true, the elevator works through floors |
width | how many tiles this platform extends on the x axis |
Procs | |
add_initial_contents | adds everything on our tile that can be added to our lift_load and initial_contents lists when we're created |
check_menu | Proc to ensure that the radial menu closes when it should. Arguments: |
create_multitile_platform | make this tram platform multitile, expanding to cover all the tram platforms adjacent to us and deleting them. makes movement more efficient. the platform becoming multitile should be in the bottom left corner since thats assumed to be the loc of multitile objects |
group_move | handles any special interactions objects could have with the lift/tram, handled on the item itself potentially finds a spot to throw the victim at for daring to be hit by a tram. is null if we havent found anything to throw handles any special interactions objects could have with the lift/tram, handled on the item itself move the movers list of movables on our tile to destination if we successfully move there first. this is like calling forceMove() on everything in movers and ourselves, except nothing in movers has destination.Entered() and origin.Exited() called on them, as only our movement can be perceived. none of the movers are able to react to the movement of any other mover, saving a lot of needless processing cost and is more sensible. without this, if you and a banana are on the same platform, when that platform moves you will slip on the banana even if youre not moving relative to it. |
lift_platform_expansion | list of turfs we dont go over. if for whatever reason we encounter an already multitile lift platform we add all of its locs to this list so we dont add that lift platform multiple times as we iterate through its locs returns an unordered list of all lift platforms adjacent to us. used so our lift_master_datum can control all connected platforms. includes platforms directly above or below us as well. only includes platforms with an identical lift_id to our own. |
on_changed_glide_size | signal handler for COMSIG_MOVABLE_UPDATE_GLIDE_SIZE: when a movable in lift_load changes its glide_size independently. adds that movable to a lazy list, movables in that list have their glide_size updated when the tram next moves |
reset_contents | reset the contents of this lift platform to its original state in case someone put too much shit on it. used by an admin via calling reset_lift_contents() on our lift_master_datum. |
set_movement_registrations | set the movement registrations to our current turf(s) so contents moving out of our tile(s) are removed from our movement lists |
show_fluff_message | Shows a message indicating that the lift has moved up or down. Arguments: |
travel | main proc for moving the lift in the direction [going]. handles horizontal and/or vertical movement for multi platformed lifts and multitile lifts. |
unset_movement_registrations | unset our movement registrations from turfs that no longer contain us (or every loc if turfs_to_unset is unspecified) |
use | list of resolve()'d initial_contents that are still in lift_load list of objects we consider foreign according to the given arguments |
Var Details
changed_gliders
lazy list of movables inside lift_load who had their glide_size changed since our last movement. used so that we dont have to change the glide_size of every object every movement, which scales to cost more than you'd think
create_multitile_platform
if TRUE, this platform will late initialize and then expand to become a multitile object across all other linked platforms on this z level
glide_size_override
what glide_size we set our moving contents to.
height
how many tiles this platform extends on the y axis (north-south not up-down, that would be the z axis)
initial_contents
lazylist of weakrefs to the contents we have when we're first created. stored so that admins can clear the tram to its initial state if someone put a bunch of stuff onto it.
lift_id
ID used to determine what lift types we can merge with
lift_load
what movables on our platform that we are moving
lift_master_datum
master datum that controls our movement. in general /industrial_lift subtypes control moving themselves, and /datum/lift_master instances control moving the entire tram and any behavior associated with that.
lift_master_type
what subtype of /datum/lift_master to create for itself if no other platform on this tram has created one yet. very important for some behaviors since
pass_through_floors
if true, the elevator works through floors
width
how many tiles this platform extends on the x axis
Proc Details
add_initial_contents
adds everything on our tile that can be added to our lift_load and initial_contents lists when we're created
check_menu
Proc to ensure that the radial menu closes when it should. Arguments:
- user - The person that opened the menu.
- starting_loc - The location of the lift when the menu was opened, used to prevent the menu from being interacted with after the lift was moved by someone else.
Returns:
- boolean, FALSE if the menu should be closed, TRUE if the menu is clear to stay opened.
create_multitile_platform
make this tram platform multitile, expanding to cover all the tram platforms adjacent to us and deleting them. makes movement more efficient. the platform becoming multitile should be in the bottom left corner since thats assumed to be the loc of multitile objects
group_move
handles any special interactions objects could have with the lift/tram, handled on the item itself potentially finds a spot to throw the victim at for daring to be hit by a tram. is null if we havent found anything to throw handles any special interactions objects could have with the lift/tram, handled on the item itself move the movers list of movables on our tile to destination if we successfully move there first. this is like calling forceMove() on everything in movers and ourselves, except nothing in movers has destination.Entered() and origin.Exited() called on them, as only our movement can be perceived. none of the movers are able to react to the movement of any other mover, saving a lot of needless processing cost and is more sensible. without this, if you and a banana are on the same platform, when that platform moves you will slip on the banana even if youre not moving relative to it.
lift_platform_expansion
list of turfs we dont go over. if for whatever reason we encounter an already multitile lift platform we add all of its locs to this list so we dont add that lift platform multiple times as we iterate through its locs returns an unordered list of all lift platforms adjacent to us. used so our lift_master_datum can control all connected platforms. includes platforms directly above or below us as well. only includes platforms with an identical lift_id to our own.
on_changed_glide_size
signal handler for COMSIG_MOVABLE_UPDATE_GLIDE_SIZE: when a movable in lift_load changes its glide_size independently. adds that movable to a lazy list, movables in that list have their glide_size updated when the tram next moves
reset_contents
reset the contents of this lift platform to its original state in case someone put too much shit on it. used by an admin via calling reset_lift_contents() on our lift_master_datum.
Arguments:
- consider_anything_past - number. if > 0 this platform will only handle foreign contents that exceed this number on each of our locs
- foreign_objects - bool. if true this platform will consider /atom/movable's that arent mobs as part of foreign contents
- foreign_non_player_mobs - bool. if true we consider mobs that dont have a mind to be foreign
- consider_player_mobs - bool. if true we consider player mobs to be foreign. only works if foreign_non_player_mobs is true as well
set_movement_registrations
set the movement registrations to our current turf(s) so contents moving out of our tile(s) are removed from our movement lists
show_fluff_message
Shows a message indicating that the lift has moved up or down. Arguments:
- going_up - Boolean on whether or not we're going up, to adjust the message appropriately.
- user - The mob that caused the lift to move, for the visible message.
travel
main proc for moving the lift in the direction [going]. handles horizontal and/or vertical movement for multi platformed lifts and multitile lifts.
unset_movement_registrations
unset our movement registrations from turfs that no longer contain us (or every loc if turfs_to_unset is unspecified)
use
list of resolve()'d initial_contents that are still in lift_load list of objects we consider foreign according to the given arguments