Files
2022-07-09 13:52:49 -06:00

40 lines
1.1 KiB
Plaintext

/obj/item/pregnancytest
name = "pregnancy test"
desc = "A one time use small device, used to determine whether someone is pregnant or not."
icon = 'hyperstation/icons/obj/pregnancytest.dmi'
throwforce = 0
icon_state = "ptest"
var/status = 0
var/results = "null"
w_class = WEIGHT_CLASS_TINY
/obj/item/pregnancytest/attack_self(mob/user)
if(QDELETED(src))
return
if(!isliving(user))
return
if(isAI(user))
return
if(user.stat > CONSCIOUS)//unconscious or dead
return
Test(user)
/obj/item/pregnancytest/proc/Test(mob/living/user)
if(status)
return
var/_results = FALSE
var/obj/item/organ/genital/womb/W = user.getorganslot("womb")
if(!W)
return // no reason to waste the single-use on them
if(W.pregnant)
_results = TRUE
UpdateResult(user, _results)
/obj/item/pregnancytest/proc/UpdateResult(mob/living/user, results)
var/result_text = results ? "positive" : "negative"
src.results = result_text
icon_state = result_text
name = "[results] preganancy test"
status = TRUE
if(user)
to_chat(user, "<span class='notice'>You use the pregnancy test, the display reads [results]!</span>")