mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 16:38:22 +01:00
Repaths obj/machinery to obj/structure/machinery. **Note for reviewers:** the only meaningful changed code exists within **code/game/objects/structures.dm** and **code/game/objects/structures/_machinery.dm**, largely concerning damage procs. With the exception of moving airlock defines to their own file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES. Objects, _categorically_, are largely divided between those you can hold in your hand/inventory and those you can't. Machinery objects are already subtypes of Structures behaviorally, this PR just makes their pathing reflect that, and allows for future work (tool actions, more health/destruction functionality) to be developed without unnecessary code duplication. I have tested this PR by loading up the Horizon and dismantling various machines and structures with tools, shooting guns of various types throughout the ship, and detonating a bunch of explosions throughout the ship.
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
/obj/item/stack/tile/light
|
|
name = "light tile"
|
|
singular_name = "light floor tile"
|
|
desc = "A floor tile, made out of glass. It produces light."
|
|
icon_state = "tile_e"
|
|
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed")
|
|
var/state = 0
|
|
|
|
/obj/item/stack/tile/light/Initialize(mapload, new_amount, merge = TRUE)
|
|
. = ..()
|
|
if(prob(5))
|
|
state = 3 //broken
|
|
else if(prob(5))
|
|
state = 2 //breaking
|
|
else if(prob(10))
|
|
state = 1 //flickering occasionally
|
|
else
|
|
state = 0 //fine
|
|
|
|
/obj/item/stack/tile/light/attackby(obj/item/attacking_item, mob/user)
|
|
if(attacking_item.tool_behaviour == TOOL_CROWBAR)
|
|
amount--
|
|
to_chat(user, SPAN_NOTICE("You pry off the steel sheet from the [name]."))
|
|
attacking_item.play_tool_sound(get_turf(src), 100)
|
|
new /obj/item/stack/material/glass/wired(user.loc)
|
|
new /obj/item/stack/material/steel(user.loc)
|
|
if(amount <= 0)
|
|
qdel(src)
|
|
else
|
|
return ..()
|
|
|
|
/obj/item/stack/tile/light/attack_self(mob/user)
|
|
amount--
|
|
playsound(src.loc, 'sound/items/Deconstruct.ogg', 80, 1)
|
|
new /obj/structure/machinery/floor_light(user.loc)
|
|
if(amount <= 0)
|
|
qdel(src)
|