Skip to content

Commit

Permalink
large crates now nom stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Nov 2, 2023
1 parent 201dbc6 commit 2194b36
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/datums/supply_packs/black_market.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ black market prices are NOT based on real or in-universe costs. they are based o
crate_heat = 5

/obj/structure/largecrate/black_market
fill_from_loc = FALSE
/// Wipes points from objects inside to avoid infinite farming.
var/points_wipe = TRUE
//no special name so it can be hidden
Expand Down
26 changes: 26 additions & 0 deletions code/game/objects/structures/crates_lockers/largecrate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
anchored = FALSE
var/parts_type = /obj/item/stack/sheet/wood
var/unpacking_sound = 'sound/effects/woodhit.ogg'
var/fill_from_loc = TRUE

/obj/structure/largecrate/Initialize(mapload, ...)
. = ..()

if(fill_from_loc)
store_items()

/obj/structure/largecrate/initialize_pass_flags(datum/pass_flags_container/PF)
..()
Expand All @@ -17,6 +24,17 @@
to_chat(user, SPAN_NOTICE("You need a crowbar to pry this open!"))
return

/obj/structure/largecrate/proc/store_items()
for(var/obj/item/location_item in loc)
if(istype(location_item, /obj/item/explosive/plastic))
var/obj/item/explosive/plastic/plastic_explosive = location_item
if(plastic_explosive.active)
continue
if(location_item.w_class > SIZE_HUGE)
continue
if(!location_item.anchored)
location_item.forceMove(src)

/obj/structure/largecrate/proc/unpack()
var/turf/current_turf = get_turf(src) // Get the turf the crate is on

Expand Down Expand Up @@ -82,9 +100,11 @@

/obj/structure/largecrate/mule
icon_state = "mulecrate"
fill_from_loc = FALSE

/obj/structure/largecrate/lisa
icon_state = "lisacrate"
fill_from_loc = FALSE

/obj/structure/largecrate/lisa/attackby(obj/item/W as obj, mob/user as mob) //ugly but oh well
if(HAS_TRAIT(W, TRAIT_TOOL_CROWBAR))
Expand All @@ -94,6 +114,7 @@
/obj/structure/largecrate/cow
name = "cow crate"
icon_state = "lisacrate"
fill_from_loc = FALSE

/obj/structure/largecrate/cow/attackby(obj/item/W as obj, mob/user as mob)
if(HAS_TRAIT(W, TRAIT_TOOL_CROWBAR))
Expand All @@ -103,6 +124,7 @@
/obj/structure/largecrate/goat
name = "goat crate"
icon_state = "lisacrate"
fill_from_loc = FALSE

/obj/structure/largecrate/goat/attackby(obj/item/W as obj, mob/user as mob)
if(HAS_TRAIT(W, TRAIT_TOOL_CROWBAR))
Expand All @@ -112,6 +134,7 @@
/obj/structure/largecrate/chick
name = "chicken crate"
icon_state = "lisacrate"
fill_from_loc = FALSE

/obj/structure/largecrate/chick/attackby(obj/item/W as obj, mob/user as mob)
if(HAS_TRAIT(W, TRAIT_TOOL_CROWBAR))
Expand All @@ -124,6 +147,7 @@
// CM largecrates
/obj/structure/largecrate/random
name = "supply crate"
fill_from_loc = FALSE
var/num_things = 0
var/list/stuff = list(/obj/item/cell/high,
/obj/item/storage/belt/utility/full,
Expand Down Expand Up @@ -306,6 +330,7 @@

/obj/structure/largecrate/guns
name = "\improper USCM firearms crate (x3)"
fill_from_loc = FALSE
var/num_guns = 3
var/num_mags = 3
var/list/stuff = list(
Expand Down Expand Up @@ -373,6 +398,7 @@

/obj/structure/largecrate/hunter_games_construction
name = "construction crate"
fill_from_loc = FALSE

/obj/structure/largecrate/hunter_games_construction/Initialize()
. = ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@

/obj/structure/largecrate/supply
name = "supply crate"
fill_from_loc = FALSE
var/list/supplies = list()

/obj/structure/largecrate/supply/Initialize()
Expand Down Expand Up @@ -334,6 +335,7 @@
name = "machine crate"
desc = "A crate containing a pre-assembled machine."
icon_state = "secure_crate_strapped"
fill_from_loc = FALSE
var/dir_needed = EAST //If set to anything but 0, will check that space before spawning in.
var/unmovable = 1 //If set to 1, then on examine, the user will see a warning that states the contents cannot be moved after opened.

Expand Down

0 comments on commit 2194b36

Please sign in to comment.