forked from Baystation12/Baystation12
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIRROR] Support Lattice Construction Fixes (#2831)
Co-authored-by: Hubblenaut <[email protected]> Co-authored-by: Lexanx <[email protected]>
- Loading branch information
1 parent
1634dc5
commit 4debf56
Showing
5 changed files
with
62 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/datum/extension/support_lattice | ||
base_type = /datum/extension/support_lattice | ||
expected_type = /atom | ||
|
||
/datum/extension/support_lattice/proc/try_construct(obj/item/C, mob/living/user) | ||
var/turf/T = get_turf(holder) | ||
if (istype(C, /obj/item/stack/material/rods)) | ||
var/obj/structure/lattice/L = locate(/obj/structure/lattice, T) | ||
if(L) | ||
return L.use_tool(C, user) | ||
var/obj/item/stack/material/rods/R = C | ||
if (!R.can_use(1)) | ||
USE_FEEDBACK_STACK_NOT_ENOUGH(R, 1, "to lay down support lattice.") | ||
return TRUE | ||
|
||
to_chat(user, SPAN_NOTICE("You lay down the support lattice.")) | ||
playsound(T, 'sound/weapons/Genhit.ogg', 50, 1) | ||
T.ReplaceWithLattice(R.material.name) | ||
R.use(1) | ||
return TRUE | ||
|
||
if (istype(C, /obj/item/stack/tile)) | ||
var/obj/structure/lattice/L = locate(/obj/structure/lattice, T) | ||
if(!L) | ||
to_chat(user, SPAN_WARNING("The plating is going to need some support.")) | ||
return TRUE | ||
var/obj/item/stack/tile/floor/S = C | ||
if (!S.can_use(1)) | ||
USE_FEEDBACK_STACK_NOT_ENOUGH(S, 1, "to place the plating.") | ||
return TRUE | ||
|
||
qdel(L) | ||
playsound(T, 'sound/weapons/Genhit.ogg', 50, 1) | ||
T.ChangeTurf(/turf/simulated/floor/plating, keep_air = TRUE) | ||
S.use(1) | ||
return TRUE | ||
|
||
if(isCoil(C)) | ||
var/obj/item/stack/cable_coil/coil = C | ||
var/obj/structure/lattice/L = locate(/obj/structure/lattice, T) | ||
if(L) | ||
coil.PlaceCableOnTurf(T, user) | ||
return TRUE | ||
else | ||
to_chat(user, SPAN_WARNING("The cable needs something to be secured to.")) | ||
return TRUE | ||
|
||
return FALSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters