Bedsheet Bedbugs (#9481)

This commit is contained in:
Doxxmedearly
2020-07-27 15:04:17 -05:00
committed by GitHub
parent 5c0059194e
commit d4bbf2f60e
2 changed files with 34 additions and 28 deletions
+28 -28
View File
@@ -37,35 +37,35 @@ LINEN BINS
add_fingerprint(user)
return
/obj/item/bedsheet/attack_hand(mob/user as mob)
/obj/item/bedsheet/attack_hand(mob/user)
if(fold || inside_storage_item)
if(inside_storage_item)
inside_storage_item = FALSE
if(!istype(loc,/mob))
if(!ismob(loc))
user.put_in_hands(src)
if(!istype(loc,/mob))
if(!ismob(loc))
toggle_roll(user)
else
..()
add_fingerprint(user)
/obj/item/bedsheet/on_enter_storage(obj/item/storage/S as obj)
/obj/item/bedsheet/on_enter_storage(obj/item/storage/S)
inside_storage_item = TRUE
return
/obj/item/bedsheet/on_exit_storage(obj/item/storage/S as obj)
/obj/item/bedsheet/on_exit_storage(obj/item/storage/S)
inside_storage_item = FALSE
return
/obj/item/bedsheet/AltClick(mob/user as mob)
/obj/item/bedsheet/AltClick(mob/user)
if(!istype(loc,/mob))
toggle_fold(user)
else
user.show_message("<span class='warning'>Drop \the [src] first.</span>")
user.show_message(SPAN_WARNING("Drop \the [src] first."))
..()
add_fingerprint(user)
/obj/item/bedsheet/MouseDrop(mob/user as mob)
/obj/item/bedsheet/MouseDrop(mob/user)
if((user && (!use_check(user))) && (user.contents.Find(src) || in_range(src, user)))
if(!istype(user, /mob/living/carbon/slime) && !istype(user, /mob/living/simple_animal))
if( !user.get_active_hand() ) //if active hand is empty
@@ -74,10 +74,10 @@ LINEN BINS
if (H.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
to_chat(user, "<span class='notice'>You try to move your [temp.name], but cannot!</span>")
to_chat(user, SPAN_NOTICE("You try to move your [temp.name], but cannot!"))
return
to_chat(user, "<span class='notice'>You pick up the [src].</span>")
to_chat(user, SPAN_NOTICE("You pick up \the [src]."))
user.put_in_hands(src)
return
@@ -97,13 +97,13 @@ LINEN BINS
else
layer = initial(layer)
/obj/item/bedsheet/verb/fold_verb(var/mob/living/user)
/obj/item/bedsheet/verb/fold_verb()
set name = "Fold Bedsheet"
set category = "Object"
set src in view(1)
if(ishuman(user))
toggle_fold(user)
if(ishuman(usr))
toggle_fold(usr)
/obj/item/bedsheet/proc/toggle_fold(var/mob/living/user) // Fold sheets to make them more portable through secret janitor-fu.
if(!user)
@@ -111,7 +111,7 @@ LINEN BINS
if(inuse)
return FALSE
if(roll)
user.show_message("<span class='warning'>Unroll \the [src] first.</span>")
user.show_message(SPAN_WARNING("Unroll \the [src] first."))
return FALSE
inuse = TRUE
if (do_after(user, 25, src))
@@ -119,7 +119,8 @@ LINEN BINS
user.do_attack_animation(src)
playsound(get_turf(loc), "rustle", 15, 1, -5)
var/folds = fold
user.visible_message("<span class='notice'>\The [user] [folds ? "unfolds" : "folds"] \the [src].", "You [fold ? "unfold" : "fold"] \the [src].</span>")
user.visible_message(SPAN_NOTICE("\The [user] [folds ? "unfolds" : "folds"] \the [src]."),
SPAN_NOTICE("You [fold ? "unfold" : "fold"] \the [src]."))
if(!fold)
fold = TRUE
slot_flags = null
@@ -135,20 +136,16 @@ LINEN BINS
inuse = FALSE
return FALSE
/obj/item/bedsheet/verb/roll_verb(var/mob/living/user)
/obj/item/bedsheet/verb/roll_verb()
set name = "Roll Bedsheet"
set category = "Object"
set src in view(1)
if(ishuman(user))
toggle_roll(user)
if(ishuman(usr))
toggle_roll(usr)
/obj/item/bedsheet/proc/toggle_roll(var/mob/living/user) // Tuck yourself in just by clicking. Also automatically rests you (if you're under it)
if(!user)
return FALSE
if(inuse)
return FALSE
if(fold)
if(!user || inuse || fold)
return FALSE
inuse = TRUE
if (do_after(user, 6, src))
@@ -156,7 +153,8 @@ LINEN BINS
user.do_attack_animation(src)
playsound(get_turf(loc), "rustle", 15, 1, -5)
var/rolls = roll
user.visible_message("<span class='notice'>\The [user] [rolls ? "unrolls" : "rolls"] \the [src].", "You [roll ? "unroll" : "roll"] \the [src].</span>")
user.visible_message(SPAN_NOTICE("\The [user] [rolls ? "unrolls" : "rolls"] \the [src]."),
SPAN_NOTICE("You [roll ? "unroll" : "roll"] \the [src]."))
if(!roll)
roll = TRUE
slot_flags = null
@@ -180,16 +178,18 @@ LINEN BINS
/obj/item/bedsheet/attackby(obj/item/I, mob/user)
if(I.isscrewdriver())
user.visible_message("<span class='notice'>\The [user] begins poking eyeholes in \the [src] with \the [I].</span>", "<span class='notice'>You begin poking eyeholes in \the [src] with \the [I].</span>")
user.visible_message(SPAN_NOTICE("\The [user] begins poking eyeholes in \the [src] with \the [I]."),
SPAN_NOTICE("You begin poking eyeholes in \the [src] with \the [I]."))
if(do_after(user, 50/I.toolspeed))
to_chat(user, "<span class='notice'>You poke eyeholes in \the [src]!</span>")
to_chat(user, SPAN_NOTICE("You poke eyeholes in \the [src]!"))
new /obj/item/bedsheet/costume(get_turf(src))
qdel(src)
return
else if(is_sharp(I))
user.visible_message("<span class='notice'>\The [user] begins cutting up [src] with [I].</span>", "<span class='notice'>You begin cutting up [src] with [I].</span>")
user.visible_message(SPAN_NOTICE("\The [user] begins cutting up [src] with [I]."),
SPAN_NOTICE("You begin cutting up [src] with [I]."))
if(do_after(user, 50/I.toolspeed))
to_chat(user, "<span class='notice'>You cut [src] into pieces!</span>")
to_chat(user, SPAN_NOTICE("You cut [src] into pieces!"))
for(var/i in 1 to rand(2,5))
new /obj/item/reagent_containers/glass/rag(get_turf(src))
qdel(src)