Goonstation 13 - Modules - TypesDefine Details

_std/macros/turf.dm

get_turfReturns the curent turf atom/x is on, through any number of nested layers
get_zGets the z-level of the turf an atom is on
getneighboursreturns a list of all neighboring turfs in cardinal directions.
issimulatedturfReturns true if x is a simulated turf
isfloorReturns true if x is a floor type
isrwallReturns true if x is a reinforced wall
DEFINE_FLOORSCreates typepaths for an unsimulated turf, a simulated turf, an airless simulated turf, and an airless unsimulated turf at compile time.
DEFINE_FLOORS_SIMMEDCreates typepaths for a /turf/simulated/floor/_PATH and a /turf/simulated/floor/airless/_PATH with vars from _VARS
DEFINE_FLOORS_UNSIMMEDCreates typepaths for a /turf/unsimulated/floor/_PATH and a /turf/unsimulated/floor/airless/_PATH with vars from _VARS
DEFINE_FLOORS_SIMMED_UNSIMMEDCreates typepaths for a /turf/simulated/floor/_PATH and a /turf/unsimulated/floor/_PATH with vars from _VARS
DEFINE_FLOORS_AIRLESSCreates typepaths for a /turf/simulated/floor/airless/_PATH and a /turf/unsimulated/floor/airless/_PATH with vars from _VARS
DEFINE_FLOOR_SIMMEDCreates a typepath for a /turf/simulated/floor/_PATH with vars from _VARS
DEFINE_FLOOR_UNSIMMEDCreates a typepath for a /turf/unsimulated/floor/_PATH with vars from _VARS
DEFINE_FLOOR_SIMMED_AIRLESSCreates a typepath for a /turf/simulated/floor/airless/_PATH with vars from _VARS
DEFINE_FLOOR_UNSIMMED_AIRLESSCreates a typepath for a /turf/unsimulated/floor/airless/_PATH with vars from _VARS

Define Details

DEFINE_FLOORS

Creates typepaths for an unsimulated turf, a simulated turf, an airless simulated turf, and an airless unsimulated turf at compile time.

_PATH should be an incomplete typepath like purple/checker or orangeblack/side/white

It will automatically be formatted into a correct typepath, like /turf/simulated/floor/purple/checker

_VARS should be variables/values that the defined type should have.

It should be formatted like:

	foo = 1\
	bar = "baz")

EXAMPLE USAGES:

	DEFINE_FLOORS(orangeblack/side/white,
		icon_state = "cautionwhite")
	DEFINE_FLOORS(damaged1,
		icon_state = "damaged1";\
		step_material = "step_plating";\
		step_priority = STEP_PRIORITY_MED)

NOTE: this macro isnt for every situation. if you need to define some procs on a turf, don't use this macro and make sure to mirror your changes across turf/floors_airless.dm, turf/floors_unsimulated.dm and turf/floors.dm.

DEFINE_FLOORS_AIRLESS

Creates typepaths for a /turf/simulated/floor/airless/_PATH and a /turf/unsimulated/floor/airless/_PATH with vars from _VARS

DEFINE_FLOORS_SIMMED

Creates typepaths for a /turf/simulated/floor/_PATH and a /turf/simulated/floor/airless/_PATH with vars from _VARS

DEFINE_FLOORS_SIMMED_UNSIMMED

Creates typepaths for a /turf/simulated/floor/_PATH and a /turf/unsimulated/floor/_PATH with vars from _VARS

DEFINE_FLOORS_UNSIMMED

Creates typepaths for a /turf/unsimulated/floor/_PATH and a /turf/unsimulated/floor/airless/_PATH with vars from _VARS

DEFINE_FLOOR_SIMMED

Creates a typepath for a /turf/simulated/floor/_PATH with vars from _VARS

DEFINE_FLOOR_SIMMED_AIRLESS

Creates a typepath for a /turf/simulated/floor/airless/_PATH with vars from _VARS

DEFINE_FLOOR_UNSIMMED

Creates a typepath for a /turf/unsimulated/floor/_PATH with vars from _VARS

DEFINE_FLOOR_UNSIMMED_AIRLESS

Creates a typepath for a /turf/unsimulated/floor/airless/_PATH with vars from _VARS

get_turf

Returns the curent turf atom/x is on, through any number of nested layers

See: http://www.byond.com/forum/?post=2110095

get_z

Gets the z-level of the turf an atom is on

getneighbours

returns a list of all neighboring turfs in cardinal directions.

isfloor

Returns true if x is a floor type

isrwall

Returns true if x is a reinforced wall

issimulatedturf

Returns true if x is a simulated turf