now this is actually based

This commit is contained in:
Hatterhat
2020-12-12 20:48:59 -06:00
parent 3e613c90e4
commit 04c35f3161
@@ -16,6 +16,32 @@
to_chat(M, "<span class='warning'>[parent] only accepts machine parts!</span>")
return FALSE
/datum/component/storage/concrete/rped/quick_empty(mob/M)
var/atom/A = parent
if(!M.canUseStorage() || !A.Adjacent(M) || M.incapacitated())
return
if(check_locked(null, M, TRUE))
return FALSE
A.add_fingerprint(M)
var/list/things = contents()
var/lowest_rating = INFINITY
for(var/obj/item/B in things)
if(B.get_part_rating() < lowest_rating)
lowest_rating = B.get_part_rating()
for(var/obj/item/B in things)
if(B.get_part_rating() > lowest_rating)
things.Remove(B)
if(lowest_rating = INFINITY)
to_chat(M, "<span class='notice'>There's no parts to dump out from [parent].</span>")
return
to_chat(M, "<span class='notice'>You start dumping out tier/cell rating [lowest_rating] parts from [parent].</span>")
var/turf/T = get_turf(A)
var/datum/progressbar/progress = new(M, length(things), T)
while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress)))
stoplag(1)
qdel(progress)
A.do_squish(0.8, 1.2)
/datum/component/storage/concrete/bluespace/rped
collection_mode = COLLECT_EVERYTHING
allow_quick_gather = TRUE
@@ -33,5 +59,29 @@
to_chat(M, "<span class='warning'>[parent] only accepts machine parts!</span>")
return FALSE
/datum/component/storage/concrete/cyborg/rped
max_items = 150
/datum/component/storage/concrete/bluespace/rped/quick_empty(mob/M)
var/atom/A = parent
if(!M.canUseStorage() || !A.Adjacent(M) || M.incapacitated())
return
if(check_locked(null, M, TRUE))
return FALSE
A.add_fingerprint(M)
var/list/things = contents()
var/lowest_rating = INFINITY
for(var/obj/item/B in things)
if(B.get_part_rating() < lowest_rating)
lowest_rating = B.get_part_rating()
for(var/obj/item/B in things)
if(B.get_part_rating() > lowest_rating)
things.Remove(B)
if(lowest_rating = INFINITY)
to_chat(M, "<span class='notice'>There's no parts to dump out from [parent].</span>")
return
to_chat(M, "<span class='notice'>You start dumping out tier/cell rating [lowest_rating] parts from [parent].</span>")
var/turf/T = get_turf(A)
var/datum/progressbar/progress = new(M, length(things), T)
while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress)))
stoplag(1)
qdel(progress)
A.do_squish(0.8, 1.2)