critical
This commit is contained in:
@@ -100,7 +100,7 @@
|
||||
|
||||
var/T = new item_path(mob)
|
||||
var/item_name = initial(item_path.name)
|
||||
var/where = mob.equip_in_one_of_slots(T, slots)
|
||||
var/where = mob.equip_in_one_of_slots(T, slots, critical = TRUE)
|
||||
if(!where)
|
||||
to_chat(mob, "<span class='userdanger'>Unfortunately, you weren't able to get a [item_name]. This is very bad and you should adminhelp immediately (press F1).</span>")
|
||||
return 0
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
var/T = new item_path(H)
|
||||
var/item_name = initial(item_path.name)
|
||||
var/where = H.equip_in_one_of_slots(T, slots)
|
||||
var/where = H.equip_in_one_of_slots(T, slots, critical = TRUE)
|
||||
if(!where)
|
||||
to_chat(H, "<span class='userdanger'>Unfortunately, you weren't able to get a [item_name]. This is very bad and you should adminhelp immediately (press F1).</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -131,14 +131,14 @@
|
||||
"left pocket" = SLOT_L_STORE,
|
||||
"right pocket" = SLOT_R_STORE
|
||||
)
|
||||
var/where = H.equip_in_one_of_slots(O, slots)
|
||||
var/where = H.equip_in_one_of_slots(O, slots, critical = TRUE)
|
||||
if (!where)
|
||||
to_chat(H, "The Syndicate were unfortunately unable to get you the AI module.")
|
||||
else
|
||||
to_chat(H, "Use the AI board in your [where] to take control of the AI, as requested by the Syndicate.")
|
||||
// Give the implant converter
|
||||
var/obj/item/overthrow_converter/I = new(H)
|
||||
where = H.equip_in_one_of_slots(I, slots)
|
||||
where = H.equip_in_one_of_slots(I, slots, critical = TRUE)
|
||||
if (!where)
|
||||
to_chat(H, "The Syndicate were unfortunately unable to get you a converter implant.")
|
||||
else
|
||||
|
||||
@@ -251,7 +251,7 @@
|
||||
"left pocket" = SLOT_L_STORE,
|
||||
"right pocket" = SLOT_R_STORE
|
||||
)
|
||||
var/where = H.equip_in_one_of_slots(T, slots)
|
||||
var/where = H.equip_in_one_of_slots(T, slots, critical = TRUE)
|
||||
if (!where)
|
||||
to_chat(H, "The Syndicate were unfortunately unable to get you a flash.")
|
||||
else
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
)
|
||||
|
||||
var/where = "At your feet"
|
||||
var/equipped_slot = mob.equip_in_one_of_slots(folder, slots)
|
||||
var/equipped_slot = mob.equip_in_one_of_slots(folder, slots, critical = TRUE)
|
||||
if (equipped_slot)
|
||||
where = "In your [equipped_slot]"
|
||||
to_chat(mob, "<BR><BR><span class='info'>[where] is a folder containing <b>secret documents</b> that another Syndicate group wants. We have set up a meeting with one of their agents on station to make an exchange. Exercise extreme caution as they cannot be trusted and may be hostile.</span><BR>")
|
||||
|
||||
@@ -14,10 +14,29 @@
|
||||
return legcuffed
|
||||
return null
|
||||
|
||||
/mob/living/carbon/proc/equip_in_one_of_slots(obj/item/I, list/slots, qdel_on_fail = 1)
|
||||
/mob/living/carbon/proc/equip_in_one_of_slots(obj/item/I, list/slots, qdel_on_fail = 1, critical = FALSE)
|
||||
for(var/slot in slots)
|
||||
if(equip_to_slot_if_possible(I, slots[slot], qdel_on_fail = 0, disable_warning = TRUE))
|
||||
return slot
|
||||
if(critical) //it is CRITICAL they get this item, no matter what
|
||||
//do they have a backpack?
|
||||
var/obj/item/backpack = get_item_by_slot(SLOT_BACK)
|
||||
if(!backpack)
|
||||
//nothing on their back
|
||||
backpack = new /obj/item/storage/backpack(get_turf(src))
|
||||
if(equip_to_slot(backpack, SLOT_BACK)) //worst-case-scenario, something that shouldnt wear a backpack gets one
|
||||
I.forceMove(backpack)
|
||||
return SLOT_BACK
|
||||
else if(istype(backpack) && SEND_SIGNAL(backpack, COMSIG_CONTAINS_STORAGE))
|
||||
//place it in here, regardless of storage capacity
|
||||
I.forceMove(backpack)
|
||||
return SLOT_BACK
|
||||
else
|
||||
//this should NEVER happen, but if it does, report it with the appropriate information
|
||||
var/conclusion = qdel_on_fail ? "deleted" : "not moved, staying at current position [I.x], [I.y], [I.z]"
|
||||
message_admins("User [src] failed to get item of critical importance: [I]. Result: item is [conclusion]")
|
||||
//it's not dropped at their turf as this is generally un-safe for midround antags and we don't know their status
|
||||
|
||||
if(qdel_on_fail)
|
||||
qdel(I)
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user