Ports duplicated slipping code to a component (#29628)

* Ports duplicated slipping code to a component

* Makes metal not slippery

* asdf

* Instead of cherry picking like an idiot I could just copy paster

* OOP

* And blood, don't forget Fry's blood!

* Further fixes

* A more generic fashion

* Use the new system

* Fixes

* Fix cartridge type

* Remove inertia
This commit is contained in:
Jordan Brown
2017-08-09 10:06:15 -04:00
committed by AnturK
parent 79bad5c881
commit 3c56d0f4f3
13 changed files with 90 additions and 49 deletions

View File

@@ -29,6 +29,9 @@
metal = ALUMINUM_FOAM
icon_state = "mfoam"
/obj/effect/particle_effect/foam/metal/MakeSlippery()
return
/obj/effect/particle_effect/foam/metal/iron
name = "iron foam"
metal = IRON_FOAM
@@ -38,12 +41,16 @@
metal = RESIN_FOAM
/obj/effect/particle_effect/foam/New(loc)
..(loc)
/obj/effect/particle_effect/foam/Initialize()
. = ..()
MakeSlippery()
create_reagents(1000) //limited by the size of the reagent holder anyway.
START_PROCESSING(SSfastprocess, src)
playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3)
/obj/effect/particle_effect/foam/proc/MakeSlippery()
AddComponent(/datum/component/slippery, 100)
/obj/effect/particle_effect/foam/Destroy()
STOP_PROCESSING(SSfastprocess, src)
return ..()
@@ -101,15 +108,6 @@
lifetime--
return 1
/obj/effect/particle_effect/foam/Crossed(atom/movable/AM)
if(istype(AM, /mob/living/carbon))
var/mob/living/carbon/M = AM
M.slip(100, src)
/obj/effect/particle_effect/foam/metal/Crossed(atom/movable/AM)
return
/obj/effect/particle_effect/foam/proc/spread_foam()
var/turf/t_loc = get_turf(src)
for(var/turf/T in t_loc.GetAtmosAdjacentTurfs())