mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 09:08:30 +01:00
[MIRROR] BSbodybags inherit heaviest item weight + Easier to escape the disarm/BSbodybag combo (#1229)
* BSbodybags inherit heaviest item weight + Easier to escape the disarm/BSbodybag combo (#54065) Bodybags now inherit the weight of their heaviest item. If it doesn't have a weight (people), we assume bulky since things like people can be firecarried or whatever. It now takes less time to get out of a bag (20 > 12 secs), and the progress bar is unbreakable unless you get incapacitated. This means people interested in using it to kidnap can still do so but it requires considerably more effort that isnt based on a latency difference and a quick disarm. The timer still runs down if you open the bag and try to put them back in but good attempt😏. This also fixes an issue with the BSB where it was picking up or otherwise doublecalling checks from inheritance. * BSbodybags inherit heaviest item weight + Easier to escape the disarm/BSbodybag combo Co-authored-by: girl <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com>
This commit is contained in:
@@ -77,8 +77,13 @@
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
to_chat(user, "<span class='notice'>You claw at the fabric of [src], trying to tear it open...</span>")
|
||||
to_chat(loc, "<span class='warning'>Someone starts trying to break free of [src]!</span>")
|
||||
if(!do_after(user, 200, target = src))
|
||||
to_chat(loc, "<span class='warning'>The pressure subsides. It seems that they've stopped resisting...</span>")
|
||||
return
|
||||
loc.visible_message("<span class='warning'>[user] suddenly appears in front of [loc]!</span>", "<span class='userdanger'>[user] breaks free of [src]!</span>")
|
||||
qdel(src)
|
||||
if(do_after_mob(user, src, 12 SECONDS, TRUE))
|
||||
if(user.loc != src)
|
||||
return
|
||||
// you are still in the bag? time to go unless you KO'd, honey!
|
||||
// if they escape during this time and you rebag them the timer is still clocking down and does NOT reset so they can very easily get out.
|
||||
if(user.incapacitated())
|
||||
to_chat(loc, "<span class='warning'>The pressure subsides. It seems that they've stopped resisting...</span>")
|
||||
return
|
||||
loc.visible_message("<span class='warning'>[user] suddenly appears in front of [loc]!</span>", "<span class='userdanger'>[user] breaks free of [src]!</span>")
|
||||
qdel(src)
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if(t)
|
||||
name = "body bag - [t]"
|
||||
name = "[initial(name)] - [t]"
|
||||
tagged = TRUE
|
||||
update_icon()
|
||||
else
|
||||
name = "body bag"
|
||||
name = initial(name)
|
||||
return
|
||||
else if(I.tool_behaviour == TOOL_WIRECUTTER)
|
||||
to_chat(user, "<span class='notice'>You cut the tag off [src].</span>")
|
||||
@@ -68,19 +68,40 @@
|
||||
/obj/structure/closet/body_bag/MouseDrop(over_object, src_location, over_location)
|
||||
. = ..()
|
||||
if(over_object == usr && Adjacent(usr) && (in_range(src, usr) || usr.contents.Find(src)))
|
||||
if(!ishuman(usr))
|
||||
if(!attempt_fold(usr))
|
||||
return
|
||||
if(opened)
|
||||
to_chat(usr, "<span class='warning'>You wrestle with [src], but it won't fold while unzipped.</span>")
|
||||
return
|
||||
if(contents.len)
|
||||
to_chat(usr, "<span class='warning'>There are too many things inside of [src] to fold it up!</span>")
|
||||
return
|
||||
visible_message("<span class='notice'>[usr] folds up [src].</span>")
|
||||
var/obj/item/bodybag/B = foldedbag_instance || new foldedbag_path
|
||||
usr.put_in_hands(B)
|
||||
perform_fold(usr)
|
||||
qdel(src)
|
||||
|
||||
/**
|
||||
* Checks to see if we can fold. Return TRUE to actually perform the fold and delete.
|
||||
*
|
||||
* Arguments:
|
||||
* * the_folder - over_object of MouseDrop aka usr
|
||||
*/
|
||||
/obj/structure/closet/body_bag/proc/attempt_fold(mob/living/carbon/human/the_folder)
|
||||
. = FALSE
|
||||
if(!istype(the_folder))
|
||||
return
|
||||
if(opened)
|
||||
to_chat(the_folder, "<span class='warning'>You wrestle with [src], but it won't fold while unzipped.</span>")
|
||||
return
|
||||
if(contents.len)
|
||||
to_chat(the_folder, "<span class='warning'>There are too many things inside of [src] to fold it up!</span>")
|
||||
return
|
||||
// toto we made it!
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* Performs the actual folding. Deleting is automatic, please do not include.
|
||||
*
|
||||
* Arguments:
|
||||
* * the_folder - over_object of MouseDrop aka usr
|
||||
*/
|
||||
/obj/structure/closet/body_bag/proc/perform_fold(mob/living/carbon/human/the_folder)
|
||||
visible_message("<span class='notice'>[usr] folds up [src].</span>")
|
||||
var/obj/item/bodybag/B = foldedbag_instance || new foldedbag_path
|
||||
the_folder.put_in_hands(B)
|
||||
|
||||
/obj/structure/closet/body_bag/bluespace
|
||||
name = "bluespace body bag"
|
||||
@@ -91,25 +112,38 @@
|
||||
mob_storage_capacity = 15
|
||||
max_mob_size = MOB_SIZE_LARGE
|
||||
|
||||
/obj/structure/closet/body_bag/bluespace/MouseDrop(over_object, src_location, over_location)
|
||||
. = ..()
|
||||
if(over_object == usr && Adjacent(usr) && (in_range(src, usr) || usr.contents.Find(src)))
|
||||
if(!ishuman(usr))
|
||||
return
|
||||
if(opened)
|
||||
to_chat(usr, "<span class='warning'>You wrestle with [src], but it won't fold while unzipped.</span>")
|
||||
return
|
||||
if(contents.len >= mob_storage_capacity / 2)
|
||||
to_chat(usr, "<span class='warning'>There are too many things inside of [src] to fold it up!</span>")
|
||||
return
|
||||
for(var/obj/item/bodybag/bluespace/B in src)
|
||||
to_chat(usr, "<span class='warning'>You can't recursively fold bluespace body bags!</span>" )
|
||||
return
|
||||
visible_message("<span class='notice'>[usr] folds up [src].</span>")
|
||||
var/obj/item/bodybag/B = foldedbag_instance || new foldedbag_path
|
||||
usr.put_in_hands(B)
|
||||
for(var/atom/movable/A in contents)
|
||||
A.forceMove(B)
|
||||
if(isliving(A))
|
||||
to_chat(A, "<span class='userdanger'>You're suddenly forced into a tiny, compressed space!</span>")
|
||||
qdel(src)
|
||||
/obj/structure/closet/body_bag/bluespace/attempt_fold(mob/living/carbon/human/the_folder)
|
||||
. = FALSE
|
||||
//copypaste zone, we do not want the content check so we don't want inheritance
|
||||
if(!istype(the_folder))
|
||||
return
|
||||
if(opened)
|
||||
to_chat(the_folder, "<span class='warning'>You wrestle with [src], but it won't fold while unzipped.</span>")
|
||||
return
|
||||
//end copypaste zone
|
||||
if(contents.len >= mob_storage_capacity / 2)
|
||||
to_chat(usr, "<span class='warning'>There are too many things inside of [src] to fold it up!</span>")
|
||||
return
|
||||
for(var/obj/item/bodybag/bluespace/B in src)
|
||||
to_chat(usr, "<span class='warning'>You can't recursively fold bluespace body bags!</span>" )
|
||||
return
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/body_bag/bluespace/perform_fold(mob/living/carbon/human/the_folder)
|
||||
visible_message("<span class='notice'>[usr] folds up [src].</span>")
|
||||
var/obj/item/bodybag/B = foldedbag_instance || new foldedbag_path
|
||||
var/max_weight_of_contents = initial(B.w_class)
|
||||
for(var/am in contents)
|
||||
var/atom/movable/content = am
|
||||
content.forceMove(B)
|
||||
if(isliving(content))
|
||||
to_chat(content, "<span class='userdanger'>You're suddenly forced into a tiny, compressed space!</span>")
|
||||
if(!isitem(content))
|
||||
max_weight_of_contents = max(WEIGHT_CLASS_BULKY, max_weight_of_contents)
|
||||
continue
|
||||
var/obj/item/A_is_item = content
|
||||
if(A_is_item.w_class < max_weight_of_contents)
|
||||
continue
|
||||
max_weight_of_contents = A_is_item.w_class
|
||||
B.w_class = max_weight_of_contents
|
||||
usr.put_in_hands(B)
|
||||
|
||||
Reference in New Issue
Block a user