Files
Polaris/code/game/objects/items/stacks/fifty_spawner.dm
MistakeNot4892 b22a0568a3 Sideports a couple of init unit tests from Neb. (#7893)
* Sideports a couple of init unit tests from Neb.

* Trying to unfuck initialize logic.

* Removing del()s.

* Adjusting return values to Initialize().

* Moving some dangerous object logic from obj onto the two types that use it.

* Rolling back some init changes and commenting out initialized atom unit test.

* this comment formatting is a minor war crime

* Removed sleep() from signaler circuit Initialize().

* Additional Init fixes post-rebase.

* Uncomments subsystem test since that's passing.
2021-02-21 12:03:34 -09:00

20 lines
835 B
Plaintext

//50-stacks as their own type was too buggy, we're doing it a different way
/obj/fiftyspawner //this doesn't need to do anything but make the stack and die so it's light
name = "50-stack spawner"
desc = "This item spawns stack of 50 of a given material."
icon = 'icons/misc/mark.dmi'
icon_state = "x4"
var/obj/item/stack/type_to_spawn = null
/obj/fiftyspawner/Initialize()
..()
var/turf/T = get_turf(src)
var/obj/structure/closet/C = locate() in T
var/obj/item/stack/M = new type_to_spawn(C || T)
M.amount = M.max_amount //some stuff spawns with 60, we're still calling it fifty
M.update_icon() // Some stacks have different sprites depending on how full they are.
return INITIALIZE_HINT_QDEL //Bye!
/obj/fiftyspawner/rods
name = "stack of rods" //this needs to be defined for cargo
type_to_spawn = /obj/item/stack/rods