mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
## About The Pull Request Thirty files changed, one's not really changed, one's actually just a copy of a change from a different pr, because for the sake of pipe cleaners I decided to change the base turf. Probably wasn't a good idea. This one contains the full set of `/turf/` `attackby()`s(besides those meant for attacks), converted all at once because the tree of turf subtypes looks a lot more like a spire than a bush. Changes beyond conversion: I added messaging for when you're crowbarring transit tube pods out of the tubes because I genuinely wasted half an hour trying to figure out what I'd done wrong in conversion because they don't look any different so I thought it wasn't working. If you're reinforcing plating and the plating is reinforced mid-reinforcement you will no longer waste your plasteel reinforcing the reinforced plating. ## Why It's Good For The Game what are we at, ~120? I was expecting this to be a lot more drawn out, but most of them are really small. I'm gonna have to do a final pass of calls to `attackby()` once the dust settles, but the end of non-attack `attackby()`s is just a week away.
239 lines
9.0 KiB
Plaintext
239 lines
9.0 KiB
Plaintext
/obj/structure/lattice
|
|
name = "lattice"
|
|
desc = "A lightweight support lattice. These hold our station together."
|
|
icon = 'icons/obj/smooth_structures/lattice.dmi'
|
|
icon_state = "lattice-255"
|
|
base_icon_state = "lattice"
|
|
density = FALSE
|
|
anchored = TRUE
|
|
armor_type = /datum/armor/structure_lattice
|
|
max_integrity = 50
|
|
layer = LATTICE_LAYER //under pipes
|
|
plane = FLOOR_PLANE
|
|
obj_flags = CAN_BE_HIT | BLOCK_Z_OUT_DOWN
|
|
smoothing_flags = SMOOTH_BITMASK
|
|
smoothing_groups = SMOOTH_GROUP_LATTICE
|
|
canSmoothWith = SMOOTH_GROUP_LATTICE + SMOOTH_GROUP_WALLS + SMOOTH_GROUP_OPEN_FLOOR
|
|
var/number_of_mats = 1
|
|
var/build_material = /obj/item/stack/rods
|
|
var/list/give_turf_traits = list(TRAIT_CHASM_STOPPED, TRAIT_HYPERSPACE_STOPPED, TRAIT_TURF_IGNORE_SLOWDOWN, TRAIT_IMMERSE_STOPPED)
|
|
|
|
/obj/structure/lattice/Initialize(mapload)
|
|
. = ..()
|
|
if (length(give_turf_traits))
|
|
give_turf_traits = string_list(give_turf_traits)
|
|
AddElement(/datum/element/give_turf_traits, give_turf_traits)
|
|
AddElement(/datum/element/footstep_override, footstep = FOOTSTEP_CATWALK)
|
|
// We check for objects in non-nearspace space in both linters and tests, so we can ignore these checks on mapload for performance
|
|
if (mapload || !isspaceturf(loc))
|
|
return
|
|
|
|
var/area/new_turf_area = get_area(loc)
|
|
if (istype(new_turf_area, /area/space) && !istype(new_turf_area, /area/space/nearstation))
|
|
set_turf_to_area(loc, GLOB.areas_by_type[/area/space/nearstation])
|
|
|
|
/datum/armor/structure_lattice
|
|
melee = 50
|
|
fire = 80
|
|
acid = 50
|
|
|
|
/obj/structure/lattice/examine(mob/user)
|
|
. = ..()
|
|
. += deconstruction_hints(user)
|
|
|
|
/obj/structure/lattice/Destroy(force) // so items on the lattice fall when the lattice is destroyed
|
|
var/turf/turfloc = loc
|
|
. = ..()
|
|
if(isturf(turfloc))
|
|
for(var/thing_that_falls in turfloc)
|
|
turfloc.zFall(thing_that_falls)
|
|
|
|
var/area/turf_area = get_area(turfloc)
|
|
if(isspaceturf(turfloc) && istype(turf_area, /area/space/nearstation))
|
|
set_turf_to_area(turfloc, GLOB.areas_by_type[/area/space])
|
|
|
|
/obj/structure/lattice/proc/deconstruction_hints(mob/user)
|
|
return span_notice("The rods look like they could be <b>cut</b>. There's space for more <i>rods</i> or a <i>tile</i>.")
|
|
|
|
/obj/structure/lattice/Initialize(mapload)
|
|
. = ..()
|
|
for(var/obj/structure/lattice/LAT in loc)
|
|
if(LAT == src)
|
|
continue
|
|
log_mapping("multiple lattices found in ([loc.x], [loc.y], [loc.z], [get_area(LAT)])")
|
|
return INITIALIZE_HINT_QDEL
|
|
|
|
/obj/structure/lattice/blob_act(obj/structure/blob/B)
|
|
return
|
|
|
|
/obj/structure/lattice/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
|
var/turf/underneath = get_turf(src)
|
|
return underneath.item_interaction(user, tool) //hand this off to the turf instead (for building plating, catwalks, etc)
|
|
|
|
/obj/structure/lattice/wirecutter_act(mob/living/user, obj/item/tool)
|
|
if(resistance_flags & INDESTRUCTIBLE)
|
|
return NONE
|
|
to_chat(user, span_notice("Slicing [name] joints ..."))
|
|
deconstruct()
|
|
return ITEM_INTERACT_SUCCESS
|
|
|
|
/obj/structure/lattice/atom_deconstruct(disassembled = TRUE)
|
|
if(!isnull(build_material) && number_of_mats >= 1)
|
|
new build_material(get_turf(src), number_of_mats)
|
|
|
|
/obj/structure/lattice/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
|
|
if(the_rcd.mode == RCD_TURF)
|
|
return list("delay" = 0, "cost" = the_rcd.rcd_design_path == /obj/structure/lattice/catwalk ? 2 : 1)
|
|
return FALSE
|
|
|
|
/obj/structure/lattice/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, list/rcd_data)
|
|
if(rcd_data[RCD_DESIGN_MODE] == RCD_TURF)
|
|
var/design_structure = rcd_data[RCD_DESIGN_PATH]
|
|
if(design_structure == /turf/open/floor/plating/rcd)
|
|
var/turf/T = src.loc
|
|
if(isgroundlessturf(T))
|
|
T.place_on_top(/turf/open/floor/plating, flags = CHANGETURF_INHERIT_AIR)
|
|
qdel(src)
|
|
return TRUE
|
|
if(design_structure == /obj/structure/lattice/catwalk)
|
|
replace_with_catwalk()
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/obj/structure/lattice/singularity_pull(atom/singularity, current_size)
|
|
if(current_size >= STAGE_FOUR)
|
|
deconstruct()
|
|
|
|
/obj/structure/lattice/proc/replace_with_catwalk()
|
|
var/list/post_replacement_callbacks = list()
|
|
SEND_SIGNAL(src, COMSIG_LATTICE_PRE_REPLACE_WITH_CATWALK, post_replacement_callbacks)
|
|
var/turf/turf = loc
|
|
qdel(src)
|
|
var/new_catwalk = new /obj/structure/lattice/catwalk(turf)
|
|
for(var/datum/callback/callback as anything in post_replacement_callbacks)
|
|
callback.Invoke(new_catwalk)
|
|
|
|
/obj/structure/lattice/catwalk
|
|
name = "catwalk"
|
|
desc = "A catwalk for easier EVA maneuvering and cable placement."
|
|
icon = 'icons/obj/smooth_structures/catwalk.dmi'
|
|
icon_state = "catwalk-0"
|
|
base_icon_state = "catwalk"
|
|
number_of_mats = 2
|
|
smoothing_flags = SMOOTH_BITMASK
|
|
smoothing_groups = SMOOTH_GROUP_CATWALK + SMOOTH_GROUP_LATTICE + SMOOTH_GROUP_OPEN_FLOOR
|
|
canSmoothWith = SMOOTH_GROUP_CATWALK
|
|
obj_flags = CAN_BE_HIT | BLOCK_Z_OUT_DOWN | BLOCK_Z_IN_UP
|
|
give_turf_traits = list(TRAIT_TURF_IGNORE_SLOWDOWN, TRAIT_LAVA_STOPPED, TRAIT_CHASM_STOPPED, TRAIT_IMMERSE_STOPPED, TRAIT_HYPERSPACE_STOPPED)
|
|
|
|
/obj/structure/lattice/catwalk/deconstruction_hints(mob/user)
|
|
return span_notice("The supporting rods look like they could be <b>cut</b>.")
|
|
|
|
/obj/structure/lattice/catwalk/Move()
|
|
var/turf/T = loc
|
|
for(var/obj/structure/cable/C in T)
|
|
C.deconstruct()
|
|
..()
|
|
|
|
/obj/structure/lattice/catwalk/atom_deconstruct(disassembled = TRUE)
|
|
..()
|
|
var/turf/T = loc
|
|
for(var/obj/structure/cable/C in T)
|
|
C.deconstruct()
|
|
|
|
/obj/structure/lattice/catwalk/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
|
|
if(the_rcd.mode == RCD_DECONSTRUCT)
|
|
return list("mode" = RCD_DECONSTRUCT, "delay" = 1 SECONDS, "cost" = 5)
|
|
return FALSE
|
|
|
|
/obj/structure/lattice/catwalk/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
|
|
if(passed_mode == RCD_DECONSTRUCT)
|
|
var/turf/turf = loc
|
|
for(var/obj/structure/cable/cable_coil in turf)
|
|
cable_coil.deconstruct()
|
|
qdel(src)
|
|
return TRUE
|
|
|
|
/obj/structure/lattice/catwalk/mining
|
|
name = "reinforced catwalk"
|
|
desc = "A heavily reinforced catwalk used to build bridges in hostile environments. It doesn't look like anything could make this budge."
|
|
resistance_flags = INDESTRUCTIBLE
|
|
|
|
/obj/structure/lattice/catwalk/mining/deconstruction_hints(mob/user)
|
|
return
|
|
|
|
/obj/structure/lattice/catwalk/lava
|
|
name = "heatproof catwalk"
|
|
desc = "A specialized catwalk for building across lava. Watch your step."
|
|
icon = 'icons/obj/smooth_structures/catwalk.dmi'
|
|
icon_state = "catwalk-0"
|
|
base_icon_state = "catwalk"
|
|
number_of_mats = 1
|
|
color = "#5286b9ff"
|
|
resistance_flags = FIRE_PROOF | LAVA_PROOF
|
|
|
|
/obj/structure/lattice/catwalk/lava/deconstruction_hints(mob/user)
|
|
return span_notice("The rods look like they could be <b>cut</b>, but the <i>heat treatment will shatter off</i>. There's space for a <i>tile</i>.")
|
|
|
|
/obj/structure/lattice/catwalk/lava/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
|
if(!ismetaltile(tool))
|
|
return ..()
|
|
var/obj/item/stack/tile/iron/attacking_tiles = tool
|
|
if(!attacking_tiles.use(1))
|
|
to_chat(user, span_warning("You need one floor tile to build atop [src]."))
|
|
return ITEM_INTERACT_BLOCKING
|
|
|
|
to_chat(user, span_notice("You construct new plating with [src] as support."))
|
|
playsound(src, 'sound/items/weapons/genhit.ogg', 50, TRUE)
|
|
|
|
var/turf/base = get_turf(src)
|
|
base.place_on_top(/turf/open/floor/plating, flags = CHANGETURF_INHERIT_AIR)
|
|
|
|
qdel(src)
|
|
return ITEM_INTERACT_SUCCESS
|
|
|
|
/obj/structure/lattice/catwalk/boulder
|
|
name = "boulder platform"
|
|
desc = "A boulder, floating on the molten hot deadly lava. More like a BOATlder."
|
|
icon = 'icons/obj/smooth_structures/boulder_platform.dmi'
|
|
icon_state = "boulder_platform-0"
|
|
base_icon_state = "boulder_platform"
|
|
smoothing_groups = SMOOTH_GROUP_BOULDER_PLATFORM
|
|
canSmoothWith = SMOOTH_GROUP_BOULDER_PLATFORM + SMOOTH_GROUP_FLOOR_LAVA
|
|
build_material = null
|
|
/// The type of particle to make before the platform collapses.
|
|
var/warning_particle = /particles/smoke/ash
|
|
|
|
/obj/structure/lattice/catwalk/boulder/Initialize(mapload)
|
|
. = ..()
|
|
fast_emissive_blocker(src)
|
|
AddElement(/datum/element/elevation, pixel_shift = 8)
|
|
|
|
/obj/structure/lattice/catwalk/boulder/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
|
if(ismetaltile(tool))
|
|
balloon_alert(user, "too unstable!")
|
|
return ITEM_INTERACT_BLOCKING
|
|
return ..()
|
|
|
|
/obj/structure/lattice/catwalk/boulder/CanAllowThrough(atom/movable/mover, border_dir)
|
|
if(istype(mover, /obj/structure/ore_box))
|
|
self_destruct()
|
|
return TRUE
|
|
. = ..()
|
|
|
|
/obj/structure/lattice/catwalk/boulder/proc/pre_self_destruct()
|
|
var/mutable_appearance/cracks_overlay = mutable_appearance('icons/obj/ore.dmi', istype(loc, /turf/open/lava/plasma) ? "plasma_cracks" : "lava_cracks", src)
|
|
cracks_overlay.blend_mode = BLEND_INSET_OVERLAY
|
|
add_overlay(cracks_overlay)
|
|
animate(src, alpha = 0, time = 2 SECONDS, pixel_y = -16, easing = QUAD_EASING|EASE_IN)
|
|
addtimer(CALLBACK(src, PROC_REF(self_destruct)), 2 SECONDS)
|
|
|
|
/**
|
|
* Handles platforms deleting themselves with a visual effect and message.
|
|
*/
|
|
/obj/structure/lattice/catwalk/boulder/proc/self_destruct()
|
|
visible_message(span_notice("\The [src] sinks and dissapears!"))
|
|
playsound(src, 'sound/effects/gas_hissing.ogg', 20)
|
|
remove_shared_particles(warning_particle)
|
|
deconstruct()
|