Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ac3d2fb
Implement persistence to trash
FabianK3 Aug 18, 2025
f7a75bc
Handle trash disposal pipe ejection
FabianK3 Aug 18, 2025
94de022
Add changelog
FabianK3 Aug 18, 2025
67269d6
Update changelog
FabianK3 Aug 18, 2025
2174086
Merge remote-tracking branch 'origin/master' into persistent-trash
FabianK3 Aug 23, 2025
e5bf9b6
Add area flag for persistent trash prevention and refactore related code
FabianK3 Aug 24, 2025
0105357
Add trash logic to base item type and refactore related code
FabianK3 Aug 24, 2025
4c4934f
Add subsystem log warning for empty content on database add
FabianK3 Aug 24, 2025
71cbe78
Fix comp, duplicate method signature
FabianK3 Aug 24, 2025
bdd911a
Add inline doc
FabianK3 Aug 24, 2025
b418552
Add support for empty persistent content
FabianK3 Aug 24, 2025
cabbbc1
Add inflatables and broken bottle to trash list
FabianK3 Aug 24, 2025
dd8d2ad
Remove empty content warn log to allow empty implementations
FabianK3 Aug 24, 2025
f991fc1
Refactore track_get_content
FabianK3 Aug 24, 2025
c3682a7
Add autoinjectors to trash list
FabianK3 Aug 24, 2025
cedae81
Add cans to trash list
FabianK3 Aug 24, 2025
c729d26
Refactore can state check order
FabianK3 Aug 25, 2025
c00e847
Update changelog
FabianK3 Aug 25, 2025
30f2b69
Fix cans spawning full
FabianK3 Aug 25, 2025
d8fe715
Merge remote-tracking branch 'origin/master' into persistent-trash
FabianK3 Sep 3, 2025
c215296
Update changelog
FabianK3 Sep 3, 2025
ad8288a
Refactor hypospray init
FabianK3 Sep 3, 2025
d219933
Add receive event to reagent container
FabianK3 Sep 3, 2025
f008d3f
Fix items not losing persistence on pickup
FabianK3 Sep 3, 2025
3ec756a
Revert "Fix items not losing persistence on pickup"
FabianK3 Sep 3, 2025
029351f
Refactore hypospry defaults
FabianK3 Sep 3, 2025
3db00e7
Remove liquid level checks
FabianK3 Sep 3, 2025
1712a16
Remove energy cans implementation
FabianK3 Sep 14, 2025
05cb2e9
Merge remote-tracking branch 'origin/master' into persistent-trash
FabianK3 Sep 14, 2025
f94ea01
Remove autoinjectors implementation
FabianK3 Sep 14, 2025
430131f
Add no trash flag to exterior and open space template area as fail safe
FabianK3 Sep 14, 2025
a83059b
Add track check when picking up trash to handle deregister trash that…
FabianK3 Sep 14, 2025
49bff69
Whitespace cleanup
FabianK3 Sep 14, 2025
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
19 changes: 10 additions & 9 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,16 @@
#define DEFAULT_JOB_TYPE /datum/job/assistant

//Area flags, possibly more to come
#define AREA_FLAG_RAD_SHIELDED BITFLAG(1) //shielded from radiation, clearly
#define AREA_FLAG_SPAWN_ROOF BITFLAG(2) // if we should attempt to spawn a roof above us.
#define AREA_FLAG_HIDE_FROM_HOLOMAP BITFLAG(3) // if we shouldn't be drawn on station holomaps
#define AREA_FLAG_FIRING_RANGE BITFLAG(4)
#define AREA_FLAG_NO_CREW_EXPECTED BITFLAG(5) // Areas where crew is not expected to ever be. Used to tell antag bases and such from crew-accessible areas on centcom level.
#define AREA_FLAG_PRISON BITFLAG(6) // Marks prison area for purposes of checking if brigged/imprisoned
#define AREA_FLAG_NO_GHOST_TELEPORT_ACCESS BITFLAG(7) // Marks whether ghosts should not have teleport access to this area
#define AREA_FLAG_INDESTRUCTIBLE_TURFS BITFLAG(8) //Marks whether or not turfs in this area can be destroyed by explosions
#define AREA_FLAG_IS_BACKGROUND BITFLAG(9) //Marks whether or not blueprints can create areas on top of this area
#define AREA_FLAG_RAD_SHIELDED BITFLAG(1) // shielded from radiation, clearly
#define AREA_FLAG_SPAWN_ROOF BITFLAG(2) // if we should attempt to spawn a roof above us.
#define AREA_FLAG_HIDE_FROM_HOLOMAP BITFLAG(3) // if we shouldn't be drawn on station holomaps
#define AREA_FLAG_FIRING_RANGE BITFLAG(4) // Area dedicated for firing pin logic
#define AREA_FLAG_NO_CREW_EXPECTED BITFLAG(5) // Areas where crew is not expected to ever be. Used to tell antag bases and such from crew-accessible areas on centcom level.
#define AREA_FLAG_PRISON BITFLAG(6) // Marks prison area for purposes of checking if brigged/imprisoned
#define AREA_FLAG_NO_GHOST_TELEPORT_ACCESS BITFLAG(7) // Marks whether ghosts should not have teleport access to this area
#define AREA_FLAG_INDESTRUCTIBLE_TURFS BITFLAG(8) // Marks whether or not turfs in this area can be destroyed by explosions
#define AREA_FLAG_IS_BACKGROUND BITFLAG(9) // Marks whether or not blueprints can create areas on top of this area
#define AREA_FLAG_PREVENT_PERSISTENT_TRASH BITFLAG(10) // Marks whether or not the area allows trash to become persistent in it

// Convoluted setup so defines can be supplied by Bay12 main server compile script.
// Should still work fine for people jamming the icons into their repo.
Expand Down
39 changes: 39 additions & 0 deletions code/game/objects/items/trash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,49 @@
desc = "General waste material, refuse or litter. Dispose responsibly."
drop_sound = 'sound/items/drop/wrapper.ogg'
pickup_sound = 'sound/items/pickup/wrapper.ogg'
persistance_expiration_time_days = 3

/obj/item/trash/attack(mob/living/target_mob, mob/living/user, target_zone)
return

/obj/item/trash/dropped(mob/user)
..()
// Trash becomes persistent only when it's not dropped in a maint or disposals, otherwise it gets deregistered
var/turf/T = get_turf(src)
if(T)
var/area/A = get_area(T)
if(A && !(A.area_flags & AREA_FLAG_PREVENT_PERSISTENT_TRASH))
SSpersistence.register_track(src, usr == null ? null : ckey(usr.key))
return
SSpersistence.deregister_track(src)

/obj/item/trash/equipped(mob/user, slot, initial = FALSE)
..()
SSpersistence.deregister_track(src) // The moment trash gets picked up it's no longer persistent

/obj/item/trash/persistence_get_content()
var/list/content = list()
content["name"] = name
content["desc"] = desc
content["icon"] = icon
content["icon_state"] = icon_state
content["item_state"] = item_state
content["drop_sound"] = drop_sound
content["pickup_sound"] = pickup_sound
return content

/obj/item/trash/persistence_apply_content(content, x, y, z)
name = content["name"]
desc = content["desc"]
icon = file(content["icon"])
icon_state = content["icon_state"]
item_state = content["item_state"]
drop_sound = file(content["drop_sound"])
pickup_sound = file(content["pickup_sound"])
src.x = x
src.y = y
src.z = z

/obj/item/trash/koisbar
name = "\improper k'ois bar wrapper"
icon_state = "koisbar"
Expand Down
10 changes: 10 additions & 0 deletions code/modules/recycling/disposal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,16 @@

return

/obj/item/trash/pipe_eject(var/direction)
// Trash becomes persistent only when it's not dropped in a maint or disposals, otherwise it gets deregistered
var/turf/T = get_turf(src)
if(T)
var/area/A = get_area(T)
if(A && !(A.area_flags & AREA_FLAG_PREVENT_PERSISTENT_TRASH))
SSpersistence.register_track(src, src.persistence_author_ckey)
return
SSpersistence.deregister_track(src)

/obj/effect/decal/cleanable/blood/gibs/pipe_eject(var/direction)
var/list/dirs
if(direction)
Expand Down
6 changes: 6 additions & 0 deletions html/changelogs/fabiank3-persistent-trash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
author: FabianK3

delete-after: True

changes:
- rscadd: "Added trash (primarily from snacks) to the persistence system. Trash will become persistent when it's dropped unless it's in a maint, in the disposals room or gets picked up again. Persistent trash can be found up to three days later."
2 changes: 1 addition & 1 deletion maps/sccv_horizon/areas/horizon_areas_maintenance.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/area/horizon/maintenance
name = "Horizon - Maintenance (PARENT AREA - DON'T USE)"
icon_state = "maintenance"
area_flags = AREA_FLAG_RAD_SHIELDED | AREA_FLAG_HIDE_FROM_HOLOMAP
area_flags = AREA_FLAG_RAD_SHIELDED | AREA_FLAG_HIDE_FROM_HOLOMAP | AREA_FLAG_PREVENT_PERSISTENT_TRASH
sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
turf_initializer = new /datum/turf_initializer/maintenance()
area_blurb = "Scarcely lit, cramped, and filled with stale, dusty air. Around you hisses compressed air through the pipes, a buzz of electrical charge through the wires, and muffled rumbles of the hull settling. This place may feel alien compared to the interior of the ship and is a place where one could get lost or badly hurt, but some may find the isolation comforting."
Expand Down
1 change: 1 addition & 0 deletions maps/sccv_horizon/areas/horizon_areas_service.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
area_blurb = "A strong, concentrated smell of many cleaning supplies linger within this room."
area_blurb_category = "janitor"
horizon_deck = 1
area_flags = AREA_FLAG_PREVENT_PERSISTENT_TRASH

/area/horizon/service/custodial/disposals
name = "Disposals and Recycling (PARENT AREA - DON'T USE)"
Expand Down
Loading