Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
40 changes: 40 additions & 0 deletions code/game/objects/items/trash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,50 @@
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)
if(!findtext(lowertext(A.name), "maint") && A.name != "Disposals and Recycling")
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
11 changes: 11 additions & 0 deletions code/modules/recycling/disposal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,17 @@

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)
if(!findtext(lowertext(A.name), "maint") && A.name != "Disposals and Recycling")
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."
Loading