Skip to content

Commit

Permalink
Merge pull request #3431 from Aroliacue/aro_objects
Browse files Browse the repository at this point in the history
New Map Decoratives
  • Loading branch information
Aroliacue authored Aug 2, 2023
2 parents 7f717b1 + 19fbe33 commit e5a1451
Show file tree
Hide file tree
Showing 9 changed files with 146 additions and 9 deletions.
1 change: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@
#include "code\game\objects\random\random.dm"
#include "code\game\objects\structures\barsign.dm"
#include "code\game\objects\structures\bedsheet_bin.dm"
#include "code\game\objects\structures\catwalk.dm"
#include "code\game\objects\structures\coathanger.dm"
#include "code\game\objects\structures\curtains.dm"
#include "code\game\objects\structures\displaycase.dm"
Expand Down
68 changes: 68 additions & 0 deletions code/game/objects/structures/catwalk.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/obj/structure/catwalk
name = "catwalk"
desc = "Cats really don't like these things."
icon = 'icons/obj/catwalks.dmi'
icon_state = "catwalk"
density = 0
anchored = 1.0
plane = ABOVE_PLATING_PLANE
layer = LATTICE_LAYER

/obj/structure/catwalk/Initialize()
. = ..()
for(var/obj/structure/catwalk/C in get_turf(src))
if(C != src)
qdel(C)
update_icon()
redraw_nearby_catwalks()


/obj/structure/catwalk/Destroy()
redraw_nearby_catwalks()
return ..()

/obj/structure/catwalk/proc/redraw_nearby_catwalks()
for(var/direction in GLOB.alldirs)
var/obj/structure/catwalk/L = locate() in get_step(src, direction)
if(L)
L.update_icon() //so siding get updated properly


/obj/structure/catwalk/update_icon()
var/connectdir = 0
for(var/direction in GLOB.cardinal)
if(locate(/obj/structure/catwalk, get_step(src, direction)))
connectdir |= direction

//Check the diagonal connections for corners, where you have, for example, connections both north and east. In this case it checks for a north-east connection to determine whether to add a corner marker or not.
var/diagonalconnect = 0 //1 = NE; 2 = SE; 4 = NW; 8 = SW
var/dirs = list(1,2,4,8)
var/i = 1
for(var/diag in list(NORTHEAST, SOUTHEAST,NORTHWEST,SOUTHWEST))
if((connectdir & diag) == diag)
if(locate(/obj/structure/catwalk, get_step(src, diag)))
diagonalconnect |= dirs[i]
i += 1

icon_state = "catwalk[connectdir]-[diagonalconnect]"


/obj/structure/catwalk/ex_act(severity)
switch(severity)
if(1)
new /obj/item/stack/rods(src.loc)
qdel(src)
if(2)
new /obj/item/stack/rods(src.loc)
qdel(src)

/obj/structure/catwalk/attackby(obj/item/C as obj, mob/user as mob)
if (istype(C, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = C
if(WT.remove_fuel(0, user))
playsound(src, 'sound/items/Welder.ogg', 100, 1)
to_chat(user, "<span class='notice'>Slicing catwalk joints ...</span>")
new /obj/item/stack/rods(src.loc)
new /obj/item/stack/rods(src.loc)
new /obj/structure/lattice/(src.loc)
qdel(src)
21 changes: 17 additions & 4 deletions code/game/objects/structures/lattice.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,18 @@
to_chat(user, "<span class='notice'>Slicing lattice joints ...</span>")
new /obj/item/stack/rods(loc)
qdel(src)

if (istype(C, /obj/item/stack/rods))
var/obj/item/stack/rods/R = C
if(R.amount <= 2)
return
else
R.use(2)
to_chat(user, "<span class='notice'>You start connecting [R.name] to [src.name] ...</span>")
if(do_after(user,50))
src.alpha = 0
new /obj/structure/catwalk(src.loc)
qdel(src)
return
return

/obj/structure/lattice/proc/updateOverlays()
Expand All @@ -73,12 +84,14 @@

var/dir_sum = 0

var/turf/T
for (var/direction in GLOB.cardinal)
if(locate(/obj/structure/lattice, get_step(src, direction)))
T = get_step(src, direction)
if(locate(/obj/structure/lattice, T) || locate(/obj/structure/catwalk, T))
dir_sum += direction
else
if(!(istype(get_step(src, direction), /turf/space)))
if(!(istype(get_step(src, direction), /turf/space)) && !(istype(get_step(src, direction), /turf/simulated/open)))
dir_sum += direction

icon_state = "lattice[dir_sum]"
return
return
Binary file added code/modules/halo/icons/railing.dmi
Binary file not shown.
7 changes: 7 additions & 0 deletions code/modules/halo/structures/_destructible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
var/mob_climb_time = 3 SECONDS
var/bump_climb = 0
var/climbable = 1
var/dodge_pass = 0

/obj/structure/destructible/New()
. = ..()
Expand Down Expand Up @@ -166,6 +167,9 @@
if(mover.throwing)
return climbable

if(dodge_pass && (mover.checkpass(PASSTABLE)))
return 1

return 0

return 1
Expand Down Expand Up @@ -206,6 +210,9 @@
if(mover.throwing)
return climbable

if(dodge_pass && (mover.checkpass(PASSTABLE)))
return 1

return 0

return 1
Expand Down
36 changes: 36 additions & 0 deletions code/modules/halo/structures/barricade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,39 @@
icon_state = "covenant_dmg1"
else
icon_state = "covenant_dmg2"

/obj/structure/destructible/railing // Really shittily-coded railings. My condolences to whoever looks at this.
name = "railing"
desc = "A metal railing."
icon = 'code/modules/halo/icons/railing.dmi'
icon_state = "railing"
flags = ON_BORDER
maxHealth = 150 // Less health than regular barricades.
health = 150
cover_rating = 15 // Significantly less cover value than barricades
dodge_pass = 1
repair_material_name = "steel"

/obj/structure/destructible/railing/corner
name = "railing corner"
desc = "A corner of a metal railing."
icon_state = "railing_corner"
flags = ON_BORDER

/obj/structure/destructible/railing/middle
name = "middle railing"
desc = "Half of a metal railing, connected to the corners."
icon_state = "railing_middle"
flags = ON_BORDER

/obj/structure/destructible/railing/halfleft
name = "half-left railing"
desc = "Half of a metal railing, connected to the corners."
icon_state = "railing_half_left"
flags = ON_BORDER

/obj/structure/destructible/railing/halfright
name = "half-right railing"
desc = "Half of a metal railing, connected to the corners."
icon_state = "railing_half_right"
flags = ON_BORDER
2 changes: 1 addition & 1 deletion code/modules/multiz/movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
if(anchored)
return FALSE

if(locate(/obj/structure/lattice, loc))
if(locate(/obj/structure/lattice, loc) || locate(/obj/structure/catwalk, loc))
return FALSE

// See if something prevents us from falling.
Expand Down
20 changes: 16 additions & 4 deletions code/modules/multiz/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,24 @@
plane = ABOVE_PLATING_PLANE
layer = ABOVE_WIRE_LAYER

/turf/simulated/open/CanZPass(atom, direction)
UpdateMobSector(atom)
/turf/simulated/open/CanZPass(atom/A, direction)
if(locate(/obj/structure/catwalk, src))
if(z == A.z)
if(direction == DOWN)
return 0
else if(direction == UP)
return 0
UpdateMobSector(A)
return 1

/turf/space/CanZPass(atom, direction)
UpdateMobSector(atom)
/turf/space/CanZPass(atom/A, direction)
if(locate(/obj/structure/catwalk, src))
if(z == A.z)
if(direction == DOWN)
return 0
else if(direction == UP)
return 0
UpdateMobSector(A)
return 1

/turf/simulated/open
Expand Down
Binary file added icons/obj/catwalks.dmi
Binary file not shown.

0 comments on commit e5a1451

Please sign in to comment.