mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-15 17:15:25 +01:00
better dirt persistence
This commit is contained in:
@@ -38,11 +38,11 @@
|
||||
icon_state = "dirt"
|
||||
mouse_opacity = 0
|
||||
|
||||
/obj/effect/decal/cleanable/Initialize(var/mapload, var/_age)
|
||||
/obj/effect/decal/cleanable/dirt/Initialize(var/mapload, var/_age, var/dirt)
|
||||
.=..()
|
||||
var/turf/simulated/our_turf = src.loc
|
||||
if(our_turf && istype(our_turf) && our_turf.can_dirty && _age)
|
||||
our_turf.dirt = 101
|
||||
if(dirt && our_turf && istype(our_turf) && our_turf.can_dirty)
|
||||
our_turf.dirt = dirt
|
||||
|
||||
/obj/effect/decal/cleanable/flour
|
||||
name = "flour"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/datum/persistent/filth
|
||||
name = "filth"
|
||||
entries_expire_at = 4 // 4 rounds, 24 hours.
|
||||
var/saves_dirt = TRUE //VOREStation edit
|
||||
|
||||
/datum/persistent/filth/IsValidEntry(var/atom/entry)
|
||||
. = ..() && entry.invisibility == 0
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/datum/persistent/filth/CheckTokenSanity(var/list/token)
|
||||
. = ..()
|
||||
return saves_dirt ? . && isnum(token["dirt"]) : .
|
||||
|
||||
/datum/persistent/filth/CreateEntryInstance(var/turf/creating, var/list/token)
|
||||
var/_path = token["path"]
|
||||
if (saves_dirt)
|
||||
new _path(creating, token["age"]+1, token["dirt"])
|
||||
else
|
||||
new _path(creating, token["age"]+1)
|
||||
|
||||
/datum/persistent/filth/proc/GetEntryDirt(var/atom/entry)
|
||||
var/turf/simulated/T = get_turf(entry)
|
||||
if (istype(T))
|
||||
return T.dirt
|
||||
return 0
|
||||
|
||||
/datum/persistent/filth/CompileEntry(var/atom/entry)
|
||||
. = ..()
|
||||
if (saves_dirt)
|
||||
LAZYADDASSOC(., "dirt", GetEntryDirt(entry))
|
||||
@@ -1,5 +1,6 @@
|
||||
/datum/persistent/filth/trash
|
||||
name = "trash"
|
||||
saves_dirt = FALSE //VOREStation edit
|
||||
|
||||
/datum/persistent/filth/trash/CheckTurfContents(var/turf/T, var/list/tokens)
|
||||
var/too_much_trash = 0
|
||||
|
||||
@@ -3456,6 +3456,7 @@
|
||||
#include "code\modules\persistence\serialize.dm"
|
||||
#include "code\modules\persistence\datum\persistence_datum.dm"
|
||||
#include "code\modules\persistence\effects\filth.dm"
|
||||
#include "code\modules\persistence\effects\filth_vr.dm"
|
||||
#include "code\modules\persistence\effects\graffiti.dm"
|
||||
#include "code\modules\persistence\effects\paper.dm"
|
||||
#include "code\modules\persistence\effects\paper_sticky.dm"
|
||||
|
||||
Reference in New Issue
Block a user