mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 19:13:30 +01:00
Removes the Sheet Snatcher 9000 (#25496)
* Yeetus Deletus * removed icon --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
* Trash Bag
|
||||
* Mining Satchel
|
||||
* Plant Bag
|
||||
* Sheet Snatcher
|
||||
* Book Bag
|
||||
* Tray
|
||||
*
|
||||
@@ -262,143 +261,6 @@
|
||||
depth = min(8, depth + 1)
|
||||
unsorted.sort(depth)
|
||||
|
||||
// -----------------------------
|
||||
// Sheet Snatcher
|
||||
// -----------------------------
|
||||
// Because it stacks stacks, this doesn't operate normally.
|
||||
// However, making it a storage/bag allows us to reuse existing code in some places. -Sayu
|
||||
|
||||
/// what is this even used for
|
||||
/obj/item/storage/bag/sheetsnatcher
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "sheetsnatcher"
|
||||
name = "Sheet Snatcher"
|
||||
desc = "A patented Nanotrasen storage system designed for any kind of mineral sheet."
|
||||
|
||||
var/capacity = 300; //the number of sheets it can carry.
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
|
||||
allow_quick_empty = TRUE // this function is superceded
|
||||
|
||||
/obj/item/storage/bag/sheetsnatcher/can_be_inserted(obj/item/W as obj, stop_messages = 0)
|
||||
if(!istype(W,/obj/item/stack/sheet) || istype(W,/obj/item/stack/sheet/mineral/sandstone) || istype(W,/obj/item/stack/sheet/wood))
|
||||
if(!stop_messages)
|
||||
to_chat(usr, "The snatcher does not accept [W].")
|
||||
return 0 //I don't care, but the existing code rejects them for not being "sheets" *shrug* -Sayu
|
||||
var/current = 0
|
||||
for(var/obj/item/stack/sheet/S in contents)
|
||||
current += S.amount
|
||||
if(capacity == current)//If it's full, you're done
|
||||
if(!stop_messages)
|
||||
to_chat(usr, "<span class='warning'>The snatcher is full.</span>")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
// Modified handle_item_insertion. Would prefer not to, but...
|
||||
/obj/item/storage/bag/sheetsnatcher/handle_item_insertion(obj/item/W as obj, mob/user, prevent_warning = FALSE)
|
||||
var/obj/item/stack/sheet/S = W
|
||||
if(!istype(S)) return 0
|
||||
|
||||
var/amount
|
||||
var/inserted = 0
|
||||
var/current = 0
|
||||
for(var/obj/item/stack/sheet/S2 in contents)
|
||||
current += S2.amount
|
||||
if(capacity < current + S.amount)//If the stack will fill it up
|
||||
amount = capacity - current
|
||||
else
|
||||
amount = S.amount
|
||||
|
||||
for(var/obj/item/stack/sheet/sheet in contents)
|
||||
if(S.type == sheet.type) // we are violating the amount limitation because these are not sane objects
|
||||
sheet.amount += amount // they should only be removed through procs in this file, which split them up.
|
||||
S.amount -= amount
|
||||
inserted = 1
|
||||
break
|
||||
|
||||
if(!inserted || !S.amount)
|
||||
usr.unEquip(S)
|
||||
usr.update_icons() //update our overlays
|
||||
if(usr.client && usr.s_active != src)
|
||||
usr.client.screen -= S
|
||||
S.dropped(usr)
|
||||
if(!S.amount)
|
||||
qdel(S)
|
||||
else
|
||||
S.loc = src
|
||||
|
||||
if(usr.s_active)
|
||||
usr.s_active.show_to(usr)
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
|
||||
// Sets up numbered display to show the stack size of each stored mineral
|
||||
// NOTE: numbered display is turned off currently because it's broken
|
||||
/obj/item/storage/bag/sheetsnatcher/orient2hud(mob/user as mob)
|
||||
var/adjusted_contents = length(contents)
|
||||
|
||||
//Numbered contents display
|
||||
var/list/datum/numbered_display/numbered_contents
|
||||
if(display_contents_with_number)
|
||||
numbered_contents = list()
|
||||
adjusted_contents = 0
|
||||
for(var/obj/item/stack/sheet/I in contents)
|
||||
adjusted_contents++
|
||||
var/datum/numbered_display/D = new/datum/numbered_display(I)
|
||||
D.number = I.amount
|
||||
numbered_contents.Add( D )
|
||||
|
||||
var/row_num = 0
|
||||
var/col_count = min(7,storage_slots) -1
|
||||
if(adjusted_contents > 7)
|
||||
row_num = round((adjusted_contents-1) / 7) // 7 is the maximum allowed width.
|
||||
standard_orient_objs(row_num, col_count, numbered_contents)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/storage/bag/sheetsnatcher/drop_inventory(mob/user)
|
||||
var/location = get_turf(src)
|
||||
for(var/obj/item/stack/sheet/S in contents)
|
||||
while(S.amount)
|
||||
var/obj/item/stack/sheet/N = new S.type(location)
|
||||
var/stacksize = min(S.amount,N.max_amount)
|
||||
N.amount = stacksize
|
||||
S.amount -= stacksize
|
||||
if(!S.amount)
|
||||
qdel(S) // todo: there's probably something missing here
|
||||
if(user.s_active)
|
||||
user.s_active.show_to(user)
|
||||
update_icon()
|
||||
|
||||
// Instead of removing
|
||||
/obj/item/storage/bag/sheetsnatcher/remove_from_storage(obj/item/W as obj, atom/new_location)
|
||||
var/obj/item/stack/sheet/S = W
|
||||
if(!istype(S)) return 0
|
||||
|
||||
//I would prefer to drop a new stack, but the item/attack_hand code
|
||||
// that calls this can't receive a different object than you clicked on.
|
||||
//Therefore, make a new stack internally that has the remainder.
|
||||
// -Sayu
|
||||
|
||||
if(S.get_amount() > S.max_amount)
|
||||
var/obj/item/stack/sheet/temp = new S.type(src)
|
||||
temp.amount = S.amount - S.max_amount
|
||||
S.amount = S.max_amount
|
||||
|
||||
return ..(S,new_location)
|
||||
|
||||
// -----------------------------
|
||||
// Sheet Snatcher (Cyborg)
|
||||
// -----------------------------
|
||||
|
||||
/obj/item/storage/bag/sheetsnatcher/borg
|
||||
name = "Sheet Snatcher 9000"
|
||||
desc = ""
|
||||
capacity = 500//Borgs get more because >specialization
|
||||
|
||||
|
||||
// -----------------------------
|
||||
// Cash Bag
|
||||
// -----------------------------
|
||||
|
||||
Reference in New Issue
Block a user