Persistent trash (#21217)

# Summary

This PR adds trash to the persistence system.

- Trash becomes persistent the moment it is dropped unless it is dropped
in a maint or the disposal room.
- It looses persistence when it lands in a maint/disposal room or gets
picked up again.
- Persistent trash can be found up to three days.

Those are the base rules, some trash types have additional rules.

List of trash to be implemented:

- [x] Basic trash (snacks and such)
  - Cigarette buts
  - spitwad
  - Burned matches
- [x] Broken bottles
- [x] Torn inflatable (-doors)

> Littering is a i120 violation and can be punished with 3-7 minutes of
prison time or with a 40-150 credit fine.
> Stop littering and keep the ship clean.

## Follow-up tasks

- [x] Update GitHub Wiki: Add section on how to add persistent trash
types.
- [x] Update GitHub Wiki: Make persistence_get_content nullable/empty.
This commit is contained in:
FabianK3
2025-09-15 12:13:46 +00:00
committed by GitHub
parent e9e1e923f5
commit 1ccfd0a0e7
11 changed files with 98 additions and 25 deletions
+24
View File
@@ -10,10 +10,34 @@
desc = "General waste material, refuse or litter. Dispose responsibly."
drop_sound = 'sound/items/drop/wrapper.ogg'
pickup_sound = 'sound/items/pickup/wrapper.ogg'
persistency_considered_trash = TRUE
/obj/item/trash/attack(mob/living/target_mob, mob/living/user, target_zone)
return
/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"