Files
Yogstation/code/datums/components/snail_crawl.dm
Ling c7226a179b Modernizes components (#17260)
* Part 1

* Refactor signals into different files

* Remove redundant file

* Add missing movable signals

* Add signals log

* Split signal registering with list into new proc

* Add comments to component.dm and remove signal_enabled

* Fix yogs code

* Not this one

* Hopefully make linter happy

* Remove duplicate file

* More duplicates signals
2023-01-04 22:29:34 +00:00

20 lines
693 B
Plaintext

/datum/component/snailcrawl
var/mob/living/carbon/snail
/datum/component/snailcrawl/Initialize()
RegisterSignals(parent, list(COMSIG_MOVABLE_MOVED), .proc/lubricate)
snail = parent
/datum/component/snailcrawl/proc/lubricate()
if(snail.resting && !snail.buckled) //s l i d e
var/turf/open/OT = get_turf(snail)
if(isopenturf(OT))
OT.MakeSlippery(TURF_WET_LUBE, 20)
snail.add_movespeed_modifier(MOVESPEED_ID_SNAIL_CRAWL, update=TRUE, priority=100, multiplicative_slowdown=-7, movetypes=GROUND)
else
snail.remove_movespeed_modifier(MOVESPEED_ID_SNAIL_CRAWL)
/datum/component/snailcrawl/_RemoveFromParent()
snail.remove_movespeed_modifier(MOVESPEED_ID_SNAIL_CRAWL)
return ..()