mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Hyposprays and autoinjectors have a delay when used on a target that is not in help intent
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
|
||||
/obj/item/weapon/reagent_containers/hypospray/attack(mob/living/M as mob, mob/user as mob)
|
||||
if(!reagents.total_volume)
|
||||
user << "<span class='warning'>[src] is empty.</span>"
|
||||
to_chat(user, "<span class='warning'>[src] is empty.</span>")
|
||||
return
|
||||
if (!istype(M))
|
||||
return
|
||||
@@ -40,21 +40,29 @@
|
||||
if(istype(H))
|
||||
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
|
||||
if(!affected)
|
||||
user << "<span class='danger'>\The [H] is missing that limb!</span>"
|
||||
to_chat(user, "<span class='danger'>\The [H] is missing that limb!</span>")
|
||||
return
|
||||
else if(affected.robotic >= ORGAN_ROBOT)
|
||||
user << "<span class='danger'>You cannot inject a robotic limb.</span>"
|
||||
to_chat(user, "<span class='danger'>You cannot inject a robotic limb.</span>")
|
||||
return
|
||||
|
||||
if(!H.stat)
|
||||
if(H != user)
|
||||
if(H.a_intent != I_HELP)
|
||||
to_chat(user, "<span class='notice'>[H] is resisting your attempt to inject them with \the [src].</span>")
|
||||
to_chat(H, "<span class='danger'> [user] is trying to inject you with \the [src]!</span>")
|
||||
if(!do_after(user, 30))
|
||||
return
|
||||
|
||||
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
|
||||
user << "<span class='notice'>You inject [M] with [src].</span>"
|
||||
M << "<span class='notice'>You feel a tiny prick!</span>"
|
||||
to_chat(user, "<span class='notice'>You inject [M] with \the [src].</span>")
|
||||
to_chat(M, "<span class='notice'>You feel a tiny prick!</span>")
|
||||
|
||||
if(M.reagents)
|
||||
var/contained = reagentlist()
|
||||
var/trans = reagents.trans_to_mob(M, amount_per_transfer_from_this, CHEM_BLOOD)
|
||||
admin_inject_log(user, M, src, contained, trans)
|
||||
user << "<span class='notice'>[trans] units injected. [reagents.total_volume] units remaining in \the [src].</span>"
|
||||
to_chat(user, "<span class='notice'>[trans] units injected. [reagents.total_volume] units remaining in \the [src].</span>")
|
||||
|
||||
if(!reusable && !used)
|
||||
used = !used
|
||||
@@ -110,7 +118,7 @@
|
||||
user << "<span class='notice'>\The [src] already has a vial.</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/hypospray/autoinjector
|
||||
name = "autoinjector"
|
||||
desc = "A rapid and safe way to administer small amounts of drugs by untrained or trained personnel."
|
||||
|
||||
Reference in New Issue
Block a user