Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a armorcheck to hyposprays. #4894

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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