Skip to content

Commit

Permalink
tweak(crates): adds overlay and height
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyThorne authored Dec 6, 2023
1 parent d5f8716 commit 7b80b15
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 12 deletions.
1 change: 1 addition & 0 deletions code/game/machinery/computer/guestpass.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
light_inner_range_on = 0.5
light_outer_range_on = 2
density = 0
turf_height_offset = 0

var/obj/item/card/id/giver
var/list/accesses = list()
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/cryopod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
circuit = /obj/item/circuitboard/cryopodcontrol
density = 0
interact_offline = 1
turf_height_offset = 0
var/datum/browser/browser = null
var/menu = MAIN

Expand Down
9 changes: 4 additions & 5 deletions code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
var/icon_off

var/welded = FALSE
var/large = TRUE
var/wall_mounted = FALSE //never solid (You can always pass over it)
var/health = 100
var/breakout = 0 //if someone is currently breaking out. mutex
Expand Down Expand Up @@ -536,20 +535,20 @@
qdel(src)

/obj/structure/closet/MouseDrop_T(atom/movable/O, mob/user)
if(QDELETED(O))
return
if(istype(O, /obj/screen)) //fix for HUD elements making their way into the world -Pete
return
if(O.loc == user)
return
if(ismob(O) && src.large)
return
if(user.restrained() || user.stat || user.weakened || user.stunned || user.paralysis)
return
if((!( istype(O, /atom/movable) ) || O.anchored || !Adjacent(user) || !Adjacent(O) || !user.Adjacent(O) || user.contents.Find(src)))
return
if(!isturf(user.loc)) // are you in a container/closet/pod/etc?
return
if(!src.opened)
return
if(!opened)
return ..()
if(istype(O, /obj/structure/closet))
return
step_towards(O, src.loc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
icon_state = "critter"
icon_opened = "critteropen"
icon_closed = "critter"

has_overlay = FALSE
turf_height_offset = 0
opened_turf_height_offset = 0
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,6 @@
icon_off = "wall-lockeroff"
dremovable = 0

//too small to put a man in
large = 0

/obj/structure/closet/secure_closet/iaa
name = "internal affairs secure closet"
req_access = list(access_iaa)
Expand Down
53 changes: 49 additions & 4 deletions code/game/objects/structures/crates_lockers/crates.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,45 @@
var/points_per_crate = 5
var/rigged = 0

var/has_overlay = TRUE
var/image/crate_overlay

turf_height_offset = 14
var/opened_turf_height_offset = 3
var/closed_turf_height_offset = 0

/obj/structure/closet/crate/Initialize()
. = ..()
if(!closed_turf_height_offset)
closed_turf_height_offset = turf_height_offset
if(has_overlay)
crate_overlay = OVERLAY(icon, "[icon_closed]over", layer = ABOVE_HUMAN_LAYER)
update_icon()

/obj/structure/closet/crate/on_update_icon()
..()
if(opened && crate_overlay)
AddOverlays(crate_overlay)

/obj/structure/closet/crate/open()
if((atom_flags & ATOM_FLAG_OPEN_CONTAINER) && !opened && can_open())
object_shaken()
. = ..()
if(.)
if(opened_turf_height_offset)
set_turf_height_offset(opened_turf_height_offset)
if(rigged)
visible_message(SPAN_DANGER("There are wires attached to the lid of [src]..."))
for(var/obj/item/device/assembly_holder/H in src)
H.process_activation(usr)
for(var/obj/item/device/assembly/A in src)
A.activate()

/obj/structure/closet/crate/close()
. = ..()
if(. && closed_turf_height_offset)
set_turf_height_offset(closed_turf_height_offset)

/obj/structure/closet/crate/_examine_text(mob/user)
. = ..()
if(rigged && opened)
Expand Down Expand Up @@ -88,10 +115,6 @@
setup = CLOSET_HAS_LOCK
locked = TRUE

/obj/structure/closet/crate/secure/Initialize()
. = ..()
update_icon()

/obj/structure/closet/crate/secure/on_update_icon()
..()
if(broken)
Expand Down Expand Up @@ -139,6 +162,9 @@
icon_closed = "trashcart"
pull_slowdown = PULL_SLOWDOWN_LIGHT

turf_height_offset = 15
opened_turf_height_offset = 4

/obj/structure/closet/crate/medical
name = "medical crate"
desc = "A medical crate."
Expand Down Expand Up @@ -182,6 +208,7 @@
icon_state = "freezer"
icon_opened = "freezeropen"
icon_closed = "freezer"
turf_height_offset = 15
var/target_temp = -40 CELSIUS
var/cooling_power = 40

Expand Down Expand Up @@ -213,6 +240,9 @@
icon_opened = "largebinopen"
icon_closed = "largebin"

turf_height_offset = 16
opened_turf_height_offset = 2

/obj/structure/closet/crate/radiation
name = "radioactive crate"
desc = "A leadlined crate with a radiation sign on it."
Expand Down Expand Up @@ -309,15 +339,23 @@
sparks = "largebinsparks"
emag = "largebinemag"

turf_height_offset = 16
opened_turf_height_offset = 2

/obj/structure/closet/crate/large
name = "large crate"
desc = "A hefty metal crate."
icon_state = "largemetal"
icon_opened = "largemetalopen"
icon_closed = "largemetal"

storage_capacity = 2 * MOB_LARGE
storage_types = CLOSET_STORAGE_ITEMS|CLOSET_STORAGE_STRUCTURES

has_overlay = FALSE
turf_height_offset = 0
opened_turf_height_offset = 0

/obj/structure/closet/crate/large/hydroponics
icon_state = "hydro_crate_large"
icon_opened = "hydro_crate_large_open"
Expand All @@ -335,6 +373,10 @@
storage_capacity = 2 * MOB_LARGE
storage_types = CLOSET_STORAGE_ITEMS|CLOSET_STORAGE_STRUCTURES

has_overlay = FALSE
turf_height_offset = 0
opened_turf_height_offset = 0

/obj/structure/closet/crate/secure/large/plasma
icon_state = "plasma_crate_large"
icon_opened = "plasma_crate_large_open"
Expand Down Expand Up @@ -383,6 +425,9 @@
storage_types = CLOSET_STORAGE_ITEMS|CLOSET_STORAGE_MOBS
pull_slowdown = PULL_SLOWDOWN_LIGHT

turf_height_offset = 15
opened_turf_height_offset = 4

/obj/structure/closet/crate/secure/biohazard/blanks/WillContain()
return list(/mob/living/carbon/human/blank, /obj/item/usedcryobag)

Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/crates_lockers/largecrate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
density = 1
atom_flags = ATOM_FLAG_CLIMBABLE
pull_slowdown = PULL_SLOWDOWN_HEAVY
turf_height_offset = 22

/obj/structure/largecrate/Initialize()
. = ..()
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mining/mine_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@
icon_closed = "miningcar"
pull_slowdown = PULL_SLOWDOWN_LIGHT

turf_height_offset = 15
opened_turf_height_offset = 3

/**********************Pinpointer**********************/

/obj/item/ore_radar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
light_outer_range_on = 1.5

density = 0
turf_height_offset = 0
var/datum/lift_master/elevator_master
var/ui_template = "elevator_control_console.tmpl"

Expand Down
Binary file modified icons/obj/crates.dmi
Binary file not shown.

0 comments on commit 7b80b15

Please sign in to comment.