Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
COMSIG_TURF_RECEIVE_SWEEPED_ITEMS = PROC_REF(ready_for_trash),
)
AddElement(/datum/element/connect_loc, loc_connections)
AddComponent(/datum/component/trash_source) // DARKPACK EDIT ADD - DECOR

/* // DARKPACK EDIT REMOVAL - No sprites for this yet.
/obj/structure/closet/crate/bin/update_overlays()
Expand Down
2 changes: 2 additions & 0 deletions modular_darkpack/modules/decor/code/decor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@
if(istype(my_area) && my_area.outdoors)
icon_state = "[base_icon_state]-snow"

AddComponent(/datum/component/trash_source)

/obj/structure/closet/crate/dumpster/PopulateContents()
if(prob(internal_trash_chance))
if(prob(95))
Expand Down
49 changes: 49 additions & 0 deletions modular_darkpack/modules/decor/code/trash_source.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#define COMSIG_OBJ_NPC_WALKBY "obj_npc_walkby"
#define DISPOSED_TRASH_TRAIT "disposed_trash"

/datum/component/trash_source
COOLDOWN_DECLARE(trash_spawn_cd)
var/datum/proximity_monitor/npc_walkby_detector/prox_monitor

/datum/component/trash_source/Initialize()
. = ..()

if(!isobj(parent))
return COMPONENT_INCOMPATIBLE

/datum/component/trash_source/RegisterWithParent()
. = ..()
RegisterSignal(parent, COMSIG_OBJ_NPC_WALKBY, PROC_REF(guy_walked_by))
prox_monitor = new(parent, 1)

/datum/component/trash_source/UnregisterFromParent()
. = ..()

UnregisterSignal(parent, COMSIG_OBJ_NPC_WALKBY)
QDEL_NULL(prox_monitor)


/datum/component/trash_source/proc/guy_walked_by(obj/source, mob/living/carbon/human/npc/walker)
if(walker.hostile || walker.aggressive)
return // We are busy beating the shit out of someone.

if(HAS_TRAIT(walker, DISPOSED_TRASH_TRAIT)) // Prevents making a conveyor of npcs to farm trash or accidential trash vortexes from stuck npcs.
return

if(COOLDOWN_FINISHED(src, trash_spawn_cd))
new /obj/effect/spawner/random/maintenance(get_turf(source))

ADD_TRAIT(walker, DISPOSED_TRASH_TRAIT, TRAIT_GENERIC)

COOLDOWN_START(src, trash_spawn_cd, rand(1 MINUTES, 5 MINUTES))


/datum/proximity_monitor/npc_walkby_detector

/datum/proximity_monitor/npc_walkby_detector/on_entered(atom/source, atom/movable/arrived, turf/old_loc)
. = ..()
if(isnpc(arrived))
SEND_SIGNAL(host, COMSIG_OBJ_NPC_WALKBY, arrived)

#undef DISPOSED_TRASH_TRAIT
#undef COMSIG_OBJ_NPC_WALKBY
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// DM Environment file for tgstation.dme.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\delivery\code\delivery_obj\delivery_dispensers.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\delivery\code\delivery_obj\delivery_map_defines.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\delivery\code\delivery_obj\delivery_recievers.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\delivery\code\delivery_datums.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\delivery\code\delivery_areas.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\delivery\code\_delivery_defs_gvars.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\delivery\code\delivery_objs.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\powers\code\discipline\mytherceria.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\powers\code\discipline\healer_valeren.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\drugs\code\bloodpacks\bloodpack_adulteration.dm.
// All manual changes should be made outside the BEGIN_ and END_ blocks.
// New source code should be placed in .dm files: choose File/New --> Code File.

Expand Down Expand Up @@ -7160,6 +7160,7 @@
#include "modular_darkpack\modules\decor\code\swaying.dm"
#include "modular_darkpack\modules\decor\code\tables.dm"
#include "modular_darkpack\modules\decor\code\trash.dm"
#include "modular_darkpack\modules\decor\code\trash_source.dm"
#include "modular_darkpack\modules\decor\code\vents.dm"
#include "modular_darkpack\modules\deprecated\code\runtime_town_types.dm"
#include "modular_darkpack\modules\do_emotes\code\do_verbs.dm"
Expand Down
Loading