mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 23:17:02 +01:00
Accessory overhaul
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
/obj/item/device/lightreplacer,
|
||||
/obj/item/device/taperecorder,
|
||||
/obj/item/device/hailer,
|
||||
/obj/item/clothing/tie/holobadge,
|
||||
/obj/item/clothing/accessory/holobadge,
|
||||
/obj/structure/closet/crate/secure,
|
||||
/obj/structure/closet/secure_closet,
|
||||
/obj/machinery/librarycomp,
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
/obj/item/weapon/plastique/afterattack(atom/target as obj|turf, mob/user as mob, flag)
|
||||
if (!flag)
|
||||
return
|
||||
if (ismob(target) || istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage/) || istype(target, /obj/machinery/door/airlock/hatch/gamma))
|
||||
if (ismob(target) || istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage) || istype(target, /obj/item/clothing/accessory/storage) || istype(target, /obj/item/clothing/under))
|
||||
return
|
||||
user << "Planting explosives..."
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
/obj/item/device/paicard,
|
||||
/obj/item/device/violin,
|
||||
/obj/item/weapon/storage/belt/utility/full,
|
||||
/obj/item/clothing/tie/horrible)
|
||||
/obj/item/clothing/accessory/horrible)
|
||||
|
||||
if(!ispath(gift_type,/obj/item)) return
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
/obj/item/weapon/storage/firstaid/tactical/New()
|
||||
..()
|
||||
if (empty) return
|
||||
new /obj/item/clothing/tie/stethoscope( src )
|
||||
new /obj/item/clothing/accessory/stethoscope( src )
|
||||
new /obj/item/weapon/surgicaldrill(src)
|
||||
new /obj/item/weapon/reagent_containers/hypospray/combat(src)
|
||||
new /obj/item/weapon/reagent_containers/pill/bicaridine(src)
|
||||
@@ -198,7 +198,7 @@
|
||||
|
||||
/obj/item/weapon/storage/pill_bottle/inaprovaline
|
||||
name = "Pill bottle (inaprovaline)"
|
||||
desc = "Contains pills used to stabilize patients."
|
||||
desc = "Contains pills used to stabilize paaccessorynts."
|
||||
|
||||
New()
|
||||
..()
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
//A storage item intended to be used by other items to provide storage functionality.
|
||||
//Types that use this should consider overriding emp_act() and hear_talk(), unless they shield their contents somehow.
|
||||
/obj/item/weapon/storage/internal
|
||||
var/obj/item/master_item
|
||||
|
||||
/obj/item/weapon/storage/internal/New(obj/item/MI)
|
||||
master_item = MI
|
||||
loc = master_item
|
||||
name = master_item.name
|
||||
verbs -= /obj/item/verb/verb_pickup //make sure this is never picked up.
|
||||
..()
|
||||
|
||||
/obj/item/weapon/storage/internal/attack_hand()
|
||||
return //make sure this is never picked up
|
||||
|
||||
/obj/item/weapon/storage/internal/mob_can_equip()
|
||||
return 0 //make sure this is never picked up
|
||||
|
||||
//Helper procs to cleanly implement internal storages - storage items that provide inventory slots for other items.
|
||||
//These procs are completely optional, it is up to the master item to decide when it's storage get's opened by calling open()
|
||||
//However they are helpful for allowing the master item to pretend it is a storage item itself.
|
||||
//If you are using these you will probably want to override attackby() as well.
|
||||
//See /obj/item/clothing/suit/storage for an example.
|
||||
|
||||
//items that use internal storage have the option of calling this to emulate default storage MouseDrop behaviour.
|
||||
//returns 1 if the master item's parent's MouseDrop() should be called, 0 otherwise. It's strange, but no other way of
|
||||
//doing it without the ability to call another proc's parent, really.
|
||||
/obj/item/weapon/storage/internal/proc/handle_mousedrop(mob/user as mob, obj/over_object as obj)
|
||||
if (ishuman(user) || ismonkey(user)) //so monkeys can take off their backpacks -- Urist
|
||||
|
||||
if (istype(user.loc,/obj/mecha)) // stops inventory actions in a mech
|
||||
return 0
|
||||
|
||||
if(over_object == user && Adjacent(user)) // this must come before the screen objects only block
|
||||
src.open(user)
|
||||
return 0
|
||||
|
||||
if (!( istype(over_object, /obj/screen) ))
|
||||
return 1
|
||||
|
||||
//makes sure master_item is equipped before putting it in hand, so that we can't drag it into our hand from miles away.
|
||||
//there's got to be a better way of doing this...
|
||||
if (!(master_item.loc == user) || (master_item.loc && master_item.loc.loc == user))
|
||||
return 0
|
||||
|
||||
if (!( user.restrained() ) && !( user.stat ))
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
user.u_equip(master_item)
|
||||
user.put_in_r_hand(master_item)
|
||||
if("l_hand")
|
||||
user.u_equip(master_item)
|
||||
user.put_in_l_hand(master_item)
|
||||
master_item.add_fingerprint(user)
|
||||
return 0
|
||||
return 0
|
||||
|
||||
//items that use internal storage have the option of calling this to emulate default storage attack_hand behaviour.
|
||||
//returns 1 if the master item's parent's attack_hand() should be called, 0 otherwise.
|
||||
//It's strange, but no other way of doing it without the ability to call another proc's parent, really.
|
||||
/obj/item/weapon/storage/internal/proc/handle_attack_hand(mob/user as mob)
|
||||
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.l_store == master_item && !H.get_active_hand()) //Prevents opening if it's in a pocket.
|
||||
H.put_in_hands(master_item)
|
||||
H.l_store = null
|
||||
return 0
|
||||
if(H.r_store == master_item && !H.get_active_hand())
|
||||
H.put_in_hands(master_item)
|
||||
H.r_store = null
|
||||
return 0
|
||||
|
||||
src.add_fingerprint(user)
|
||||
if (master_item.loc == user)
|
||||
src.open(user)
|
||||
return 0
|
||||
|
||||
for(var/mob/M in range(1, master_item.loc))
|
||||
if (M.s_active == src)
|
||||
src.close(M)
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/storage/internal/Adjacent(var/atom/neighbor)
|
||||
return master_item.Adjacent(neighbor)
|
||||
@@ -104,12 +104,12 @@
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/item/clothing/tie/medal/gold/heroism(src)
|
||||
new /obj/item/clothing/tie/medal/silver/security(src)
|
||||
new /obj/item/clothing/tie/medal/silver/valor(src)
|
||||
new /obj/item/clothing/tie/medal/nobel_science(src)
|
||||
new /obj/item/clothing/tie/medal/bronze_heart(src)
|
||||
new /obj/item/clothing/tie/medal/conduct(src)
|
||||
new /obj/item/clothing/tie/medal/conduct(src)
|
||||
new /obj/item/clothing/tie/medal/conduct(src)
|
||||
new /obj/item/clothing/tie/medal/gold/captain(src)
|
||||
new /obj/item/clothing/accessory/medal/gold/heroism(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/security(src)
|
||||
new /obj/item/clothing/accessory/medal/silver/valor(src)
|
||||
new /obj/item/clothing/accessory/medal/nobel_science(src)
|
||||
new /obj/item/clothing/accessory/medal/bronze_heart(src)
|
||||
new /obj/item/clothing/accessory/medal/conduct(src)
|
||||
new /obj/item/clothing/accessory/medal/conduct(src)
|
||||
new /obj/item/clothing/accessory/medal/conduct(src)
|
||||
new /obj/item/clothing/accessory/medal/gold/captain(src)
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
var/allow_quick_gather //Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.
|
||||
var/collection_mode = 1; //0 = pick one at a time, 1 = pick all on tile
|
||||
var/foldable = null // BubbleWrap - if set, can be folded (when empty) into a sheet of cardboard
|
||||
var/use_sound = "rustle" //sound played when used. null for no sound.
|
||||
|
||||
/obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
|
||||
if (ishuman(usr) || ismonkey(usr)) //so monkeys can take off their backpacks -- Urist
|
||||
@@ -100,6 +101,15 @@
|
||||
if(user.s_active == src)
|
||||
user.s_active = null
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/proc/open(mob/user as mob)
|
||||
if (src.use_sound)
|
||||
playsound(src.loc, src.use_sound, 50, 1, -5)
|
||||
|
||||
orient2hud(user)
|
||||
if (user.s_active)
|
||||
user.s_active.close(user)
|
||||
show_to(user)
|
||||
|
||||
/obj/item/weapon/storage/proc/close(mob/user as mob)
|
||||
|
||||
@@ -450,6 +460,39 @@
|
||||
del(src)
|
||||
//BubbleWrap END
|
||||
|
||||
//Returns the storage depth of an atom. This is the number of storage items the atom is contained in before reaching toplevel (the area).
|
||||
//Returns -1 if the atom was not found on container.
|
||||
/atom/proc/storage_depth(atom/container)
|
||||
var/depth = 0
|
||||
var/atom/cur_atom = src
|
||||
|
||||
while (cur_atom && !(cur_atom in container.contents))
|
||||
if (isarea(cur_atom))
|
||||
return -1
|
||||
if (istype(cur_atom.loc, /obj/item/weapon/storage))
|
||||
depth++
|
||||
cur_atom = cur_atom.loc
|
||||
|
||||
if (!cur_atom)
|
||||
return -1 //inside something with a null loc.
|
||||
|
||||
return depth
|
||||
|
||||
|
||||
|
||||
//Like storage depth, but returns the depth to the nearest turf
|
||||
//Returns -1 if no top level turf (a loc was null somewhere, or a non-turf atom's loc was an area somehow).
|
||||
/atom/proc/storage_depth_turf()
|
||||
var/depth = 0
|
||||
var/atom/cur_atom = src
|
||||
|
||||
while (cur_atom && !isturf(cur_atom))
|
||||
if (isarea(cur_atom))
|
||||
return -1
|
||||
if (istype(cur_atom.loc, /obj/item/weapon/storage))
|
||||
depth++
|
||||
cur_atom = cur_atom.loc
|
||||
|
||||
if (!cur_atom)
|
||||
return -1 //inside something with a null loc.
|
||||
|
||||
return depth
|
||||
|
||||
Reference in New Issue
Block a user