This commit is contained in:
Fluffy
2024-03-03 19:52:57 +00:00
committed by GitHub
parent 548bdbb3b7
commit cf056641d3
29 changed files with 119 additions and 39 deletions
+17 -9
View File
@@ -454,14 +454,27 @@
playsound(src, drop_sound, THROW_SOUND_VOLUME)
return ..()
//Apparently called whenever an item is dropped on the floor, thrown, or placed into a container.
//It is called after loc is set, so if placed in a container its loc will be that container.
/obj/item/proc/dropped(var/mob/user)
/**
* Called when an item is removed from a `/mob` inventory (including hands and whatnot),
* for whatever reason (dropped on the floor, thrown, put in a container, etc.)
*
* This is called after the _new_ location (`loc`) is set on the object, so if it's eg. put in a container,
* the loc inside here would point to the container, not the mob that had it in hand
*
* * user - The `/mob` that dropped the object
*/
/obj/item/proc/dropped(mob/user)
SHOULD_CALL_PARENT(TRUE)
remove_item_verbs(user)
if(item_flags & ITEM_FLAG_HELD_MAP_TEXT)
check_maptext()
if(zoom)
zoom(user) //binoculars, scope, etc
SEND_SIGNAL(src, COMSIG_ITEM_REMOVE, src)
SEND_SIGNAL(src, COMSIG_ITEM_DROPPED, user)
/obj/item/proc/remove_item_verbs(mob/user)
if(ismech(user)) //very snowflake, but necessary due to how mechs work
@@ -1150,11 +1163,6 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
if(item_flags & ITEM_FLAG_HELD_MAP_TEXT)
check_maptext()
/obj/item/dropped(var/mob/user)
..()
if(item_flags & ITEM_FLAG_HELD_MAP_TEXT)
check_maptext()
// used to check whether the item is capable of popping things like balloons, inflatable barriers, or cutting police tape.
/obj/item/proc/can_puncture()
if(sharp || edge)
+1 -1
View File
@@ -276,7 +276,7 @@
name = initial(name)
update_icon()
/obj/item/shockpaddles/dropped(var/mob/living/user)
/obj/item/shockpaddles/dropped(mob/user)
..()
if(user)
var/obj/item/offhand/O = user.get_inactive_hand()
@@ -94,7 +94,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
user.visible_message("In a feat of redundancy, <b>[user]</b> lights \the [src] using \the [attacking_item].", range = 3)
light()
/obj/item/flame/match/dropped(mob/user as mob)
/obj/item/flame/match/dropped(mob/user)
if(lit)
spawn(0)
var/turf/location = src.loc // Light up the turf we land on.
@@ -39,7 +39,7 @@
register_owner(user)
//Handles dropped or thrown cloakers
/obj/item/cloaking_device/dropped(var/mob/user)
/obj/item/cloaking_device/dropped(mob/user)
..()
var/mob/M = get_holding_mob()
if(!M)
@@ -83,7 +83,7 @@
O.unwield()
return ..()
/obj/item/material/twohanded/dropped(mob/user as mob)
/obj/item/material/twohanded/dropped(mob/user)
. = ..()
//handles unwielding a twohanded weapon when dropped as well as clearing up the offhand
if(user)
@@ -39,7 +39,7 @@
edge = initial(edge)
w_class = initial(w_class)
/obj/item/melee/energy/dropped(var/mob/user)
/obj/item/melee/energy/dropped(mob/user)
..()
if(!istype(loc,/mob))
deactivate(user)
@@ -64,7 +64,7 @@
else
return ..()
/obj/item/storage/laundry_basket/dropped(mob/user as mob)
/obj/item/storage/laundry_basket/dropped(mob/user)
qdel(linked)
return ..()
@@ -84,7 +84,7 @@
pickup_sound = null
equip_sound = null
/obj/item/storage/laundry_basket/offhand/dropped(mob/user as mob)
/obj/item/storage/laundry_basket/offhand/dropped(mob/user)
. = ..()
user.drop_from_inventory(linked)
@@ -745,7 +745,7 @@
attacking_item.add_fingerprint(user)
return handle_item_insertion(attacking_item, null, user)
/obj/item/storage/dropped(mob/user as mob)
/obj/item/storage/dropped(mob/user)
return ..()
/obj/item/storage/attack_hand(mob/user)