mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-24 00:51:46 +00:00
A bunch of fixes for various stuff that's been broken about the bag of holding. It should work as intended, now. Made wet floor signs fit in boxes. Cleaned up the janitor's closet a bit. Optimised the vault wiring a bit. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2580 316c924e-a436-60f5-8080-3fe189b3f50e
73 lines
2.3 KiB
Plaintext
73 lines
2.3 KiB
Plaintext
/obj/item/weapon/storage/backpack/MouseDrop(obj/over_object as obj)
|
|
|
|
// if (src.loc != usr)
|
|
// return
|
|
// if ((istype(usr, /mob/living/carbon/human) || (ticker && ticker.mode.name == "monkey")))
|
|
if (ishuman(usr) || ismonkey(usr)) //so monkeys can take off their backpacks -- Urist
|
|
var/mob/M = usr
|
|
if (!( istype(over_object, /obj/screen) ))
|
|
return ..()
|
|
playsound(src.loc, "rustle", 50, 1, -5)
|
|
if ((!( M.restrained() ) && !( M.stat ) && M.back == src))
|
|
if (over_object.name == "r_hand")
|
|
if (!( M.r_hand ))
|
|
M.u_equip(src)
|
|
M.r_hand = src
|
|
else
|
|
if (over_object.name == "l_hand")
|
|
if (!( M.l_hand ))
|
|
M.u_equip(src)
|
|
M.l_hand = src
|
|
M.update_clothing()
|
|
src.add_fingerprint(usr)
|
|
return
|
|
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
|
|
if (usr.s_active)
|
|
usr.s_active.close(usr)
|
|
src.show_to(usr)
|
|
return
|
|
return
|
|
|
|
/obj/item/weapon/storage/backpack/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
playsound(src.loc, "rustle", 50, 1, -5)
|
|
..()
|
|
|
|
|
|
/obj/item/weapon/storage/backpack/holding
|
|
name = "Bag of Holding"
|
|
desc = "A backpack that opens into a localized pocket of Blue Space."
|
|
origin_tech = "bluespace=4"
|
|
icon_state = "holdingpack"
|
|
max_w_class = 4
|
|
max_combined_w_class = 28
|
|
|
|
New()
|
|
..()
|
|
return
|
|
|
|
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
if(crit_fail)
|
|
user << "\red The Bluespace generator isn't working."
|
|
return
|
|
if(istype(W, /obj/item/weapon/storage/backpack/holding) && !W.crit_fail)
|
|
user << "\red The Bluespace interfaces of the two devices catastrophically malfunction!"
|
|
del(W)
|
|
var/obj/machinery/singularity/singulo = new /obj/machinery/singularity (get_turf(src))
|
|
singulo.energy = 300 //should make it a bit bigger~
|
|
message_admins("[key_name_admin(user)] detonated a bag of holding")
|
|
log_game("[key_name(user)] detonated a bag of holding")
|
|
del(src)
|
|
return
|
|
..()
|
|
|
|
proc/failcheck(mob/user as mob)
|
|
if (prob(src.reliability)) return 1 //No failure
|
|
if (prob(src.reliability))
|
|
user << "\red The Bluespace portal resists your attempt to add another item." //light failure
|
|
else
|
|
user << "\red The Bluespace generator malfunctions!"
|
|
for (var/obj/O in src.contents) //it broke, delete what was in it
|
|
del(O)
|
|
crit_fail = 1
|
|
icon_state = "brokenpack"
|