Merge pull request #552 from quotefox/revert-545-mobholders

Revert "Mob_holder and examine microopt"
This commit is contained in:
Dahlular
2020-10-04 10:59:56 -06:00
committed by GitHub
2 changed files with 22 additions and 19 deletions
+11 -9
View File
@@ -94,7 +94,7 @@
lefthand_file = left_hand
if(right_hand)
righthand_file = right_hand
slot_flags = slots
slot_flags = slots
/obj/item/clothing/head/mob_holder/proc/assimilate(mob/living/target)
target.setDir(SOUTH)
@@ -102,8 +102,6 @@
target.forceMove(src)
var/image/I = new //work around to retain the same appearance to the mob idependently from inhands/worn states.
I.appearance = target.appearance
I.layer = FLOAT_LAYER //So it doesn't get screwed up by layer overrides.
I.plane = FLOAT_PLANE //Same as above but for planes.
I.override = TRUE
add_overlay(I)
name = target.name
@@ -113,23 +111,27 @@
w_class = WEIGHT_CLASS_TINY
if(MOB_SIZE_SMALL)
w_class = WEIGHT_CLASS_NORMAL
if(MOB_SIZE_HUMAN)
w_class = WEIGHT_CLASS_BULKY
if(MOB_SIZE_LARGE)
w_class = WEIGHT_CLASS_HUGE
RegisterSignal(src, COMSIG_CLICK_SHIFT, .proc/examine_held_mob, override = TRUE)
/obj/item/clothing/head/mob_holder/Destroy()
if(held_mob)
release()
return ..()
/obj/item/clothing/head/mob_holder/examine(mob/user)
return held_mob?.examine(user) || ..()
/obj/item/clothing/head/mob_holder/proc/examine_held_mob(datum/source, mob/user)
held_mob.ShiftClick(user)
return COMPONENT_DENY_EXAMINATE
/obj/item/clothing/head/mob_holder/Exited(atom/movable/AM, atom/newloc)
. = ..()
if(AM == held_mob)
held_mob.reset_perspective()
held_mob = null
QDEL_IN(src, 1) //To avoid a qdel loop.
qdel(src)
/obj/item/clothing/head/mob_holder/Entered(atom/movable/AM, atom/newloc)
. = ..()
@@ -159,7 +161,7 @@
/obj/item/clothing/head/mob_holder/container_resist()
if(isliving(loc))
var/mob/living/L = loc
L.visible_message("<span class='warning'>[held_mob] escapes from [L]!</span>", "<span class='warning'>[held_mob] escapes your grip!</span>")
L.visible_message("<span class='warning'>[src] escapes from [L]!</span>", "<span class='warning'>[src] escapes your grip!</span>")
release()
/obj/item/clothing/head/mob_holder/assume_air(datum/gas_mixture/env)
@@ -171,7 +173,7 @@
location = location.loc
if(ismob(location))
return location.loc.assume_air(env)
return location.assume_air(env)
return loc.assume_air(env)
/obj/item/clothing/head/mob_holder/remove_air(amount)
var/atom/location = loc
@@ -182,4 +184,4 @@
location = location.loc
if(ismob(location))
return location.loc.remove_air(amount)
return location.remove_air(amount)
return loc.remove_air(amount)
+11 -10
View File
@@ -289,31 +289,32 @@
add_overlay(new_overlays)
/atom/proc/examine(mob/user)
. = list("[get_examine_string(user, TRUE)].")
to_chat(user, get_examine_string(user, TRUE))
if(desc)
. += desc
to_chat(user, desc)
if(reagents)
if(reagents.reagents_holder_flags & TRANSPARENT)
. += "It contains:"
if(length(reagents.reagent_list))
to_chat(user, "It contains:")
if(reagents.reagent_list.len)
if(user.can_see_reagents()) //Show each individual reagent
for(var/datum/reagent/R in reagents.reagent_list)
. += "[R.volume] units of [R.name]"
to_chat(user, "[R.volume] units of [R.name]")
else //Otherwise, just show the total volume
var/total_volume = 0
for(var/datum/reagent/R in reagents.reagent_list)
total_volume += R.volume
. += "[total_volume] units of various reagents"
to_chat(user, "[total_volume] units of various reagents")
else
. += "Nothing."
to_chat(user, "Nothing.")
else if(reagents.reagents_holder_flags & AMOUNT_VISIBLE)
if(reagents.total_volume)
. += "<span class='notice'>It has [reagents.total_volume] unit\s left.</span>"
to_chat(user, "<span class='notice'>It has [reagents.total_volume] unit\s left.</span>")
else
. += "<span class='danger'>It's empty.</span>"
to_chat(user, "<span class='danger'>It's empty.</span>")
SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .)
SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user)
/atom/proc/relaymove(mob/user)
if(buckle_message_cooldown <= world.time)