mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-07-22 05:32:58 +01:00
[READY]Makes a bunch of processes subsystems instead (#5814
* Converts various New() definitions to Initialization() * Adds absolute pathing
This commit is contained in:
@@ -4,27 +4,27 @@
|
||||
icon = 'icons/misc/mark.dmi'
|
||||
icon_state = "rup"
|
||||
var/spawn_nothing_percentage = 0 // this variable determines the likelyhood that this random object will not spawn anything
|
||||
var/drop_get_turf = TRUE
|
||||
|
||||
// creates a new object and deletes itself
|
||||
/obj/random/New()
|
||||
..()
|
||||
spawn()
|
||||
if(istype(src.loc, /obj/structure/loot_pile)) //Spawning from a lootpile is weird, need to wait until we're out of it to do our work.
|
||||
while(istype(src.loc, /obj/structure/loot_pile))
|
||||
sleep(1)
|
||||
if (!prob(spawn_nothing_percentage))
|
||||
spawn_item()
|
||||
qdel(src)
|
||||
/obj/random/Initialize()
|
||||
. = ..()
|
||||
if (!prob(spawn_nothing_percentage))
|
||||
spawn_item()
|
||||
qdel(src)
|
||||
|
||||
// this function should return a specific item to spawn
|
||||
/obj/random/proc/item_to_spawn()
|
||||
return 0
|
||||
|
||||
/obj/random/drop_location()
|
||||
return drop_get_turf? get_turf(src) : ..()
|
||||
|
||||
// creates the random item
|
||||
/obj/random/proc/spawn_item()
|
||||
var/build_path = item_to_spawn()
|
||||
|
||||
var/atom/A = new build_path(src.loc)
|
||||
var/atom/A = new build_path(drop_location())
|
||||
if(pixel_x || pixel_y)
|
||||
A.pixel_x = pixel_x
|
||||
A.pixel_y = pixel_y
|
||||
|
||||
Reference in New Issue
Block a user