mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-26 02:02:39 +00:00
63 lines
1.7 KiB
Plaintext
63 lines
1.7 KiB
Plaintext
/obj/item/weapon/storage/backpack/New()
|
|
|
|
new /obj/item/weapon/storage/box( src )
|
|
..()
|
|
return
|
|
|
|
/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")))
|
|
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)
|
|
|
|
if (src.contents.len >= 7)
|
|
return
|
|
if (W.w_class > 3 || src.loc == W)
|
|
return
|
|
var/t
|
|
for(var/obj/item/weapon/O in src)
|
|
t += O.w_class
|
|
//Foreach goto(46)
|
|
t += W.w_class
|
|
if (t > 20)
|
|
user << "You cannot fit the item inside. (Remove larger classed items)"
|
|
return
|
|
playsound(src.loc, "rustle", 50, 1, -5)
|
|
user.u_equip(W)
|
|
W.loc = src
|
|
if ((user.client && user.s_active != src))
|
|
user.client.screen -= W
|
|
src.orient2hud(user)
|
|
W.dropped(user)
|
|
if (istype(W, /obj/item/weapon/gun/energy/crossbow)) return //STEALTHY
|
|
add_fingerprint(user)
|
|
for(var/mob/O in viewers(user, null))
|
|
O.show_message(text("\blue [] has added [] to []!", user, W, src), 1)
|
|
//Foreach goto(206)
|
|
return
|