Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. /obj/item/stack/medical/chem_patch
  2. name = "chem patch"
  3. desc = "A membrane coated with skin-permeable carrier chemicals. On other words, stick it on you."
  4. animal_heal = 0
  5. heal_brute = 0
  6. heal_burn = 0
  7. w_class = ITEM_SIZE_TINY
  8. amount = 1
  9. max_amount = 1
  10. icon_state = "brutepack"
  11. var/mob/living/carbon/affecting_mob // what mob are we affecting?
  12. var/transfer_per_tick = 0.5
  13.  
  14. /obj/item/stack/medical/chem_patch/New()
  15. create_reagents(60)
  16.  
  17. /obj/item/stack/medical/chem_patch/Destroy()
  18. STOP_PROCESSING(SSobj,src)
  19. affecting_mob = null
  20. ..()
  21.  
  22. /obj/item/stack/medical/chem_patch/Process()
  23. world << "process call patch"
  24. reagents.trans_to_mob(affecting_mob, transfer_per_tick, CHEM_TOUCH)
  25. world << "transfering to mob"
  26. if(reagents.total_volume == 0)
  27. Destroy()
  28. world << "out of reagents, bye"
  29.  
  30. /obj/item/stack/medical/chem_patch/attack(mob/living/carbon/M as mob, mob/user as mob)
  31. if(..())
  32. return 1
  33.  
  34. if (istype(M, /mob/living/carbon/human))
  35. var/mob/living/carbon/human/H = M
  36. var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) //nullchecked by ..()
  37. var/limb = affecting.name
  38. user.visible_message("<span class='danger'>[user] starts to apply \the [src] to [M]'s [limb].</span>", "<span class='danger'>You start to apply \the [src] to [M]'s [limb].</span>", "<span class='danger'>You hear something being wrapped.</span>")
  39. if(do_after(user, 10, M))
  40. user.remove_from_mob(src)
  41. src.forceMove(affecting)
  42. src.affecting_mob = H
  43. START_PROCESSING(SSobj,src)
  44. if (M != user)
  45. user.visible_message("<span class='danger'>\The [user] finishes applying [src] to [M]'s [limb].</span>", "<span class='danger'>You finish applying \the [src] to [M]'s [limb].</span>", "<span class='danger'>You hear something being wrapped.</span>")
  46. else
  47. user.visible_message("<span class='danger'>\The [user] successfully applies [src] to their [limb].</span>", "<span class='danger'>You successfully apply \the [src] to your [limb].</span>", "<span class='danger'>You hear something being wrapped.</span>")
  48. return
  49.  
  50. /obj/item/stack/medical/chem_patch/test
  51. name = "test patch"
  52.  
  53. /obj/item/stack/medical/chem_patch/test/New()
  54. ..()
  55. reagents.add_reagent(/datum/reagent/space_drugs, 60)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement