Skip to content

Commit

Permalink
fixes catwalks forever
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikalpo committed Sep 30, 2023
1 parent 4aa7af2 commit 3a1cee2
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 18 deletions.
4 changes: 2 additions & 2 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@
if(!T)
return FALSE
for(var/atom/movable/AM in T)
if(AM.flags_1 & PREVENT_CLICK_UNDER_1 && AM.density && AM.layer > layer)
if(AM.flags_1 & PREVENT_CLICK_UNDER_1 && AM.layer > layer)//NSV make it so prevent_click_under doesn't need density
return TRUE
return FALSE

/turf/IsObscured()
for(var/atom/movable/AM in src)
if(AM.flags_1 & PREVENT_CLICK_UNDER_1 && AM.density)
if(AM.flags_1 & PREVENT_CLICK_UNDER_1)//NSV make it so prevent_click_under doesn't need density
return TRUE
return FALSE

Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,7 @@
update_freelook_sight()
sleep(door_animation_speed) //Nsv13 - SPEEDY DOORS
density = FALSE
flags_1 &= ~PREVENT_CLICK_UNDER_1//NSV make it so prevent_click_under doesn't need density
air_update_turf(1)
sleep(1)
layer = OPEN_DOOR_LAYER
Expand Down Expand Up @@ -1298,10 +1299,12 @@
layer = CLOSED_DOOR_LAYER
if(air_tight)
density = TRUE
flags_1 |= PREVENT_CLICK_UNDER_1//NSV make it so prevent_click_under doesn't need density
air_update_turf(1)
sleep(1)
if(!air_tight)
density = TRUE
flags_1 |= PREVENT_CLICK_UNDER_1//NSV make it so prevent_click_under doesn't need density
air_update_turf(1)
sleep(door_animation_speed) //Nsv13 - SPEEDY DOORS
if(!safe)
Expand Down
5 changes: 5 additions & 0 deletions code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
var/max_moles = min_moles
// okay this is a bit hacky. First, we set density to 0 and recalculate our adjacent turfs
density = FALSE
flags_1 &= ~PREVENT_CLICK_UNDER_1//NSV make it so prevent_click_under doesn't need density
T.ImmediateCalculateAdjacentTurfs()
// then we use those adjacent turfs to figure out what the difference between the lowest and highest pressures we'd be holding is
for(var/turf/open/T2 in T.atmos_adjacent_turfs)
Expand All @@ -230,6 +231,7 @@
if(moles > max_moles)
max_moles = moles
density = TRUE
flags_1 |= PREVENT_CLICK_UNDER_1//NSV make it so prevent_click_under doesn't need density
T.ImmediateCalculateAdjacentTurfs() // alright lets put it back
return max_moles - min_moles > 20

Expand Down Expand Up @@ -311,6 +313,7 @@
set_opacity(0)
sleep(open_speed)
density = FALSE
flags_1 &= ~PREVENT_CLICK_UNDER_1//NSV make it so prevent_click_under doesn't need density
sleep(open_speed)
layer = initial(layer)
update_icon()
Expand Down Expand Up @@ -341,8 +344,10 @@
layer = closingLayer
if(air_tight)
density = TRUE
flags_1 |= PREVENT_CLICK_UNDER_1//NSV make it so prevent_click_under doesn't need density
sleep(open_speed)
density = TRUE
flags_1 |= PREVENT_CLICK_UNDER_1//NSV make it so prevent_click_under doesn't need density
sleep(open_speed)
update_icon()
if(visible && !glass)
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/structures/catwalk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
smooth = SMOOTH_TRUE
canSmoothWith = null
obj_flags = CAN_BE_HIT | BLOCK_Z_OUT_DOWN | BLOCK_Z_IN_UP
flags_1 = PREVENT_CLICK_UNDER_1//NSV make it so prevent_click_under doesn't need density
//Negates the effect of space and openspace.
//Shouldn't be placed above anything else.
FASTDMM_PROP(\
Expand Down Expand Up @@ -44,7 +45,7 @@

/obj/structure/lattice/catwalk/deconstruct()
var/turf/T = loc
if(!istype(src, /obj/structure/lattice/catwalk/over/ship)) // NSV13 - don't cut cables if the catwalk goes *over* the cables
if(!istype(src, /obj/structure/lattice/catwalk/over)) // NSV13 - don't cut cables if the catwalk goes *over* the cables
for(var/obj/structure/cable/C in T)
C.deconstruct()
..()
Expand Down
9 changes: 2 additions & 7 deletions code/game/turfs/open/floor/plating.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
R.use(1)
to_chat(user, "<span class='notice'>You reinforce the floor.</span>")
return
else if(istype(C, /obj/item/stack/tile) && !locate(/obj/structure/lattice/catwalk, src))
else if(istype(C, /obj/item/stack/tile))//NSV allow placing tiles under open plated catwalks
if(!broken && !burnt)
for(var/obj/O in src)
if(O.level == 1) //ex. pipes laid underneath a tile
Expand Down Expand Up @@ -169,9 +169,4 @@
return

/turf/open/floor/plating/can_have_cabling()
// NSV13 - let us put cables into open plated catwalk tiles
var/obj/structure/lattice/catwalk/C = locate(/obj/structure/lattice/catwalk, src)
if(C)
return C.can_lay_cable()
return 1

return TRUE//NSV don't need this check now that catwalks block clicking
2 changes: 1 addition & 1 deletion code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ GLOBAL_LIST_EMPTY(created_baseturf_lists)
// Removes all signs of lattice on the pos of the turf -Donkieyo
/turf/proc/RemoveLattice()
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L && (L.flags_1 & INITIALIZED_1))
if(L && (L.flags_1 & INITIALIZED_1) && !istype(L, /obj/structure/lattice/catwalk/over/))//NSV but not "over" catwalks
qdel(L)

/turf/proc/phase_damage_creatures(damage,mob/U = null)//>Ninja Code. Hurts and knocks out creatures on this turf //NINJACODE
Expand Down
39 changes: 37 additions & 2 deletions nsv13/code/game/objects/items/stacks/tiles/tile_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
mineralType = "durasteel"
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 70, "stamina" = 0)
resistance_flags = FIRE_PROOF
var/catwalk_type = null
var/list/tilelist = list( \
"durasteel_tile", \
"durasteel_tile_alt", \
Expand All @@ -40,7 +41,7 @@
"eris_techfloor_alt_tile", \
"lino_tile", \
"techfloor_tile", \
"tech_grid_tile", \
"techfloor_grid_tile", \
"monotile_steel", \
"monotile_dark", \
"monotile_light", \
Expand All @@ -55,12 +56,17 @@
"eris_techfloor_alt_tile" = /turf/open/floor/durasteel/eris_techfloor_alt, \
"lino_tile" = /turf/open/floor/durasteel/lino, \
"techfloor_tile" = /turf/open/floor/durasteel/techfloor, \
"tech_grid_tile" = /turf/open/floor/durasteel/techfloor_grid, \
"techfloor_grid_tile" = /turf/open/floor/durasteel/techfloor_grid, \
"monotile_steel" = /turf/open/floor/monotile/steel, \
"monotile_dark" = /turf/open/floor/monotile/dark, \
"monotile_light" = /turf/open/floor/monotile/light, \
"monofloor_tile" = /turf/open/floor/monofloor \
)
var/list/catwalktypes = list( \
"monotile_steel" = /obj/structure/lattice/catwalk/over/ship, \
"monotile_dark" = /obj/structure/lattice/catwalk/over/ship/dark, \
"monotile_light" = /obj/structure/lattice/catwalk/over/ship/light, \
)

/obj/item/stack/tile/durasteel/Initialize(mapload, amount)
. = ..()
Expand All @@ -70,15 +76,41 @@
/obj/item/stack/tile/durasteel/examine(mob/user)
. = ..()
. += "<span class='notice'>Ctrl-click to change the tile type.</span>"
if(catwalk_type)
. += "<span class='notice'>There are attachment points for <i>rods</i>.</span>"

/obj/item/stack/tile/durasteel/CtrlClick(mob/user)
if((istype(user) && user.canUseTopic(src, BE_CLOSE, ismonkey(user))) && !is_cyborg && user.is_holding(src)) //Only activate when in your hand
var/choice = show_radial_menu(user, user, tilelist)
if(choice)
icon_state = choice
turf_type = tiletypes[icon_state] //it JUST works
catwalk_type = catwalktypes[icon_state]
return ..()

/obj/item/stack/tile/durasteel/attackby(obj/item/W, mob/user, params)//plated catwalk construction
add_fingerprint(user)
if(istype(W, /obj/item/stack/rods))
if(!catwalk_type)
to_chat(user, "<span class='warning'>You can't make a plated catwalk with this variant of tile!</span>")
return
var/turf/T = get_turf(usr)
if(locate(/obj/structure/lattice/catwalk) in T)
to_chat(user, "<span class='warning'>There is already a catwalk here!</span>")
return
if(!isfloorturf(T))
to_chat(user, "<span class='warning'>You can only build a plated catwalk on a floor!</span>")
return
var/obj/item/stack/rods/V = W
if (V.get_amount() >= 2 && get_amount() >= 1)
new catwalk_type(T)
V.use(2)
use(1)
else
to_chat(user, "<span class='warning'>You need two rods and one tile to make a plated catwalk!</span>")
return
else
return ..()
/obj/item/stack/tile/durasteel/alt
icon_state = "durasteel_tile_alt"
turf_type = /turf/open/floor/durasteel/alt
Expand Down Expand Up @@ -114,14 +146,17 @@
/obj/item/stack/tile/durasteel/mono_steel
icon_state = "monotile_steel"
turf_type = /turf/open/floor/monotile/steel
catwalk_type = /obj/structure/lattice/catwalk/over/ship

/obj/item/stack/tile/durasteel/mono_dark
icon_state = "monotile_dark"
turf_type = /turf/open/floor/monotile/dark
catwalk_type = /obj/structure/lattice/catwalk/over/ship/dark

/obj/item/stack/tile/durasteel/mono_light
icon_state = "monotile_light"
turf_type = /turf/open/floor/monotile/light
catwalk_type = /obj/structure/lattice/catwalk/over/ship/light

/obj/item/stack/tile/durasteel/monofloor
icon_state = "monofloor_tile"
Expand Down
24 changes: 19 additions & 5 deletions nsv13/code/game/objects/structures/catwalk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
canSmoothWith = null
obj_flags = CAN_BE_HIT
var/hatch_open = FALSE //To easily access wiring
var/plating_type = /obj/item/stack/tile/durasteel/mono_steel

/obj/structure/lattice/catwalk/over/ship/light
color = "#ffffff"
icon_state = "catwalk_platedwhite"
plating_type = /obj/item/stack/tile/durasteel/mono_light

/obj/structure/lattice/catwalk/over/ship/dark
color = "#4c535b" //Curse you baystation
color = "#575757" //Curse you baystation
plating_type = /obj/item/stack/tile/durasteel/mono_dark

/obj/structure/lattice/catwalk/over/ship/crowbar_act(mob/living/user, obj/item/I)
var/turf/T = get_turf(src)
Expand All @@ -38,13 +40,25 @@
if(hatch_open)
icon_state = "catwalk_hatch_open"
obj_flags &= ~(BLOCK_Z_OUT_DOWN | BLOCK_Z_IN_UP) //Minecraft trap door.
flags_1 &= ~PREVENT_CLICK_UNDER_1
smooth = SMOOTH_FALSE
clear_smooth_overlays()
queue_smooth(src)
else
icon_state = initial(icon_state)
icon_state = ""
obj_flags |= (BLOCK_Z_OUT_DOWN | BLOCK_Z_IN_UP)
flags_1 |= PREVENT_CLICK_UNDER_1
smooth = SMOOTH_TRUE
queue_smooth(src)

/obj/structure/lattice/catwalk/over/ship/can_lay_cable()
return hatch_open

/obj/structure/lattice/catwalk/over/ship/deconstruct()
new plating_type(get_turf(src))
. = ..()

/obj/structure/lattice/catwalk/over/attackby(obj/item/C, mob/user, params)
if(resistance_flags & INDESTRUCTIBLE)
return
if(C.tool_behaviour == TOOL_WIRECUTTER)
to_chat(user, "<span class='notice'>Slicing [name] joints ...</span>")
deconstruct()
Binary file modified nsv13/icons/obj/smooth_structures/catwalk_plated.dmi
Binary file not shown.

0 comments on commit 3a1cee2

Please sign in to comment.