Skip to content

Commit

Permalink
Adds a armorcheck to hyposprays. (#4894)
Browse files Browse the repository at this point in the history
If a target is armored, then it takes some time to inject them with a hypospray (simmilar to the needles).
  • Loading branch information
Arrow768 authored and skull132 committed Jun 22, 2018
1 parent 98ee68a commit 6481d97
Show file tree
Hide file tree
Showing 3 changed files with 246 additions and 207 deletions.
10 changes: 7 additions & 3 deletions code/modules/reagents/reagent_containers/hypospray.dm
Expand Up @@ -20,7 +20,7 @@
// reagents.add_reagent("tricordrazine", 30)
// return

/obj/item/weapon/reagent_containers/hypospray/attack(mob/living/M as mob, mob/user as mob)
/obj/item/weapon/reagent_containers/hypospray/attack(mob/living/M as mob, mob/user as mob, var/target_zone)
if(!reagents.total_volume)
user << "<span class='warning'>[src] is empty.</span>"
return
Expand All @@ -29,17 +29,21 @@

var/mob/living/carbon/human/H = M
if(istype(H))
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
var/obj/item/organ/external/affected = H.get_organ(target_zone)
if(!affected)
user << "<span class='danger'>\The [H] is missing that limb!</span>"
return
else if(affected.status & ORGAN_ROBOT)
user << "<span class='danger'>You cannot inject a robotic limb.</span>"
return

user.visible_message("<span class='warning'>[user] is trying to inject [target] with [src]!</span>","<span class='notice'>You are trying to inject [M] with [src].</span>")
if(H.run_armor_check(target_zone,"melee",0,"Your armor slows down the injection!","Your armor slows down the injection!"))
if(!do_mob(user, M, 60))
return

user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
user.do_attack_animation(M)
user << "<span class='notice'>You inject [M] with [src].</span>"
M << "<span class='notice'>You feel a tiny prick!</span>"
playsound(src, 'sound/items/hypospray.ogg',25)

Expand Down

0 comments on commit 6481d97

Please sign in to comment.