Skip to content

Commit

Permalink
even more hitbxes & fxes & shit
Browse files Browse the repository at this point in the history
  • Loading branch information
MLGTASTICa committed Aug 14, 2024
1 parent 3f445db commit cb07448
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 39 deletions.
2 changes: 1 addition & 1 deletion code/_compile_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
// 2 for preloading absolutely everything;
//#define LOWMEMORYMODE 1

#define BULLETDEBUG 1
//#define BULLETDEBUG 1

//Update this whenever you need to take advantage of more recent byond features
#define MIN_COMPILER_VERSION 514
Expand Down
15 changes: 13 additions & 2 deletions code/game/machinery/buttons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,25 @@
wifi_sender = new/datum/wifi/sender/button(_wifi_id, src)

//// YES this doesn't rely on proper mapping because i can't really replace most of them and wouldn't make sense in most cases anyway.(since pixel_x and pixel_y will always vary etc etc.)
var/attachmentDir = (pixel_x > 16)*EAST | (pixel_x < -16)*WEST | (pixel_y > 16)*NORTH | (pixel_y <16)*SOUTH
var/turf/toAttach = get_step(loc, attachmentDir)
var/attachmentDir = (pixel_x > 16)*EAST | (pixel_x < -16)*WEST | (pixel_y > 16)*NORTH | (pixel_y < -16)*SOUTH
var/turf/toAttach
if(!attachmentDir)
stack_trace("[src.type] is directly placed ontop of a wall / not on a wall at X:[x] Y:[y] Z:[z], this shoudln't be done so buttons don't show on other sides of the walls.")
color = COLOR_PINK
name = "I am bugged tell devs!!"
desc = "Bugged at X:[x] Y:[y] Z:[z]"
toAttach = get_turf(src)
else
toAttach = get_step(loc, attachmentDir)
dir = reverse_dir[attachmentDir]

if(iswall(toAttach))
toAttach.attachGameAtom(src, ATFS_PRIORITIZE_ATTACHED_FOR_HITS, ATFA_EASY_INTERACTIVE | ATFA_DIRECTIONAL_HITTABLE )
else
stack_trace("[src.type] has no wall to attach itself to at X:[x] Y:[y] Z:[z]")
// the players need to be confused so they complain about it!
name = "I am bugged tell devs!!"
desc = "Bugged at X:[x] Y:[y] Z:[z]"
color = COLOR_PINK


Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/camera/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@

/obj/machinery/camera/Initialize(mapload, d)
. = ..()
/// sim-camera.
if(!isturf(loc))
return
var/turf/toAttach = get_step(loc, reverse_dir[dir])

if(iswall(toAttach))
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/computer/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
density = TRUE
anchored = TRUE
use_power = IDLE_POWER_USE
hitbox = /datum/hitboxDatum/atom/modularConsole
idle_power_usage = 300
active_power_usage = 300
var/processing = 0
Expand Down
27 changes: 11 additions & 16 deletions code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@

/obj/machinery/door/New()
GLOB.all_doors += src
..()
. = ..()
if(density)
layer = closed_layer
update_heat_protection(get_turf(src))
else
layer = open_layer

health = maxHealth

update_nearby_tiles(need_rebuild=TRUE)

/obj/machinery/door/Destroy()
GLOB.all_doors -= src
Expand All @@ -67,24 +76,12 @@
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN*1.5)
attack_animation(user)

/obj/machinery/door/New()
. = ..()
if(density)
layer = closed_layer
update_heat_protection(get_turf(src))
else
layer = open_layer

health = maxHealth

update_nearby_tiles(need_rebuild=TRUE)
return

/// modifying bounds when the map is not fully loaded causes improper detection
/// this was apparent when done through DMMSuite loading , where left/right facing multi-tile
/// wouldn't work , because the right turf didn't exist at the moment or was replaced, erasing its
/// contents list - SPCR 2024
/obj/machinery/door/Initialize(mapload, d)
. = ..()
if(width > 1)
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
Expand All @@ -93,8 +90,6 @@
bound_width = world.icon_size
bound_height = width * world.icon_size



/obj/machinery/door/Destroy()
density = FALSE
update_nearby_tiles()
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/doors/firedoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
description_info = "Can be deconstructed by welding closed, screwing and crowbaring the circuits out."
icon_state = "door_open"
req_one_access = list(access_atmospherics, access_engine_equip, access_medical_equip)
hitbox = /datum/hitboxDatum/turf/door
opacity = FALSE
density = FALSE
layer = BELOW_OPEN_DOOR_LAYER
Expand Down
8 changes: 7 additions & 1 deletion code/game/objects/items/devices/radio/intercom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@

/obj/item/device/radio/intercom/Initialize()
. = ..()
var/turf/toAttach = get_step(loc, reverse_dir[dir])

/// We are a internal intercom, not for game-usage.
if(!isturf(loc))
return
//// YES this doesn't rely on proper mapping because i can't really replace most of them and wouldn't make sense in most cases anyway.(since pixel_x and pixel_y will always vary etc etc.)
var/attachmentDir = (pixel_x > 16)*EAST | (pixel_x < -16)*WEST | (pixel_y > 16)*NORTH | (pixel_y < -16)*SOUTH
var/turf/toAttach = get_step(loc, attachmentDir)

if(iswall(toAttach))
toAttach.attachGameAtom(src, ATFS_PRIORITIZE_ATTACHED_FOR_HITS, ATFA_EASY_INTERACTIVE | ATFA_DIRECTIONAL_HITTABLE )
Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/hitbox_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ boolean lineLine(float x1, float y1, float x2, float y2, float x3, float y3, flo
LISTWEST = list(BBOX(11,8,23,25,LEVEL_CHEST-3,LEVEL_CHEST+3,null))
)

/datum/hitboxDatum/atom/camera
/datum/hitboxDatum/atom/camera
boundingBoxes = list(
LISTSOUTH = list(BBOX(14,27,17,32,LEVEL_HEAD-3, LEVEL_HEAD+3,null)),
LISTNORTH = list(BBOX(12,1,20,7,LEVEL_HEAD-3, LEVEL_HEAD+3,null)),
Expand Down Expand Up @@ -461,7 +461,7 @@ boolean lineLine(float x1, float y1, float x2, float y2, float x3, float y3, flo
LISTWEST = list(BBOX(8,8,25,25,LEVEL_TURF+3, LEVEL_TURF+6,null))
)

/datum/hitboxDatum/atom/atmosphericVentScrubber
/datum/hitboxDatum/atom/atmosphericVentScrubber
boundingBoxes = list(
LISTSOUTH = list(BBOX(8,8,24,25,LEVEL_TURF-2, LEVEL_TURF,null)),
LISTNORTH = list(BBOX(8,8,24,25,LEVEL_TURF-2, LEVEL_TURF,null)),
Expand Down
20 changes: 3 additions & 17 deletions maps/CEVEris/_CEV_Eris.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -17209,13 +17209,6 @@
/obj/structure/catwalk,
/turf/simulated/open,
/area/eris/security/barracks)
"aQN" = (
/obj/structure/catwalk,
/obj/machinery/camera/network/security{
dir = 8
},
/turf/simulated/open,
/area/eris/security/main)
"aQO" = (
/obj/structure/catwalk,
/obj/machinery/atmospherics/pipe/simple/hidden/supply{
Expand All @@ -17235,13 +17228,6 @@
/obj/structure/catwalk,
/turf/simulated/open,
/area/eris/security/barracks)
"aQR" = (
/obj/structure/catwalk,
/obj/machinery/camera/network/security{
dir = 8
},
/turf/simulated/open,
/area/eris/security/barracks)
"aQT" = (
/obj/machinery/atmospherics/unary/vent_pump/on{
dir = 8
Expand Down Expand Up @@ -99946,7 +99932,7 @@
/area/eris/hallway/side/section3deck2port)
"gey" = (
/obj/machinery/camera/network/research{
dir = 8
dir = 1
},
/obj/item/storage/toolbox/mechanical,
/obj/structure/table/reinforced,
Expand Down Expand Up @@ -168353,7 +168339,7 @@ aaA
aaa
aac
aQJ
aQN
aQJ
aQT
aac
aBl
Expand Down Expand Up @@ -171989,7 +171975,7 @@ aaA
aaa
aag
aQL
aQR
aQL
bNB
aag
aag
Expand Down

0 comments on commit cb07448

Please sign in to comment.