mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Pill refactor and bug fixing (#15274)
* Removes spawn() when dissolve pill in reagent container Also fixes some messages * General pill refactor Fix exploit allowing injection of reagents into pills New() -> Initialize() Third-person message upon dissolving pill no longer displays to the user, mimicking visible_message Make all pill names improper, with the chemical capitalized Fixes grammar in Haloperidol pill * Update code/modules/reagents/reagent_containers/pill.dm Co-authored-by: Farie82 <farie82@users.noreply.github.com> * Remove liquid requirement Co-authored-by: Farie82 <farie82@users.noreply.github.com>
This commit is contained in:
@@ -1,25 +1,26 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Pills.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* # Pill
|
||||
*
|
||||
* A swallowable pill. Can be dissolved in reagent containers.
|
||||
*/
|
||||
/obj/item/reagent_containers/food/pill
|
||||
name = "pill"
|
||||
desc = "a pill."
|
||||
desc = "A pill."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = null
|
||||
item_state = "pill"
|
||||
container_type = NONE
|
||||
possible_transfer_amounts = null
|
||||
volume = 100
|
||||
has_lid = FALSE
|
||||
consume_sound = null
|
||||
can_taste = FALSE
|
||||
antable = FALSE
|
||||
|
||||
/obj/item/reagent_containers/food/pill/New()
|
||||
..()
|
||||
/obj/item/reagent_containers/food/pill/Initialize(mapload)
|
||||
. = ..()
|
||||
if(!icon_state)
|
||||
icon_state = "pill[rand(1,20)]"
|
||||
|
||||
/obj/item/reagent_containers/food/pill/attack_self(mob/user)
|
||||
return
|
||||
icon_state = "pill[rand(1, 20)]"
|
||||
|
||||
/obj/item/reagent_containers/food/pill/attack(mob/living/carbon/M, mob/user, def_zone)
|
||||
if(!istype(M))
|
||||
@@ -31,34 +32,23 @@
|
||||
return FALSE
|
||||
|
||||
/obj/item/reagent_containers/food/pill/afterattack(obj/target, mob/user, proximity)
|
||||
if(!proximity)
|
||||
if(!proximity || !target.is_open_container())
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You [!target.reagents.total_volume ? "break open" : "dissolve"] [src] in [target].</span>")
|
||||
for(var/mob/O in oviewers(2, user))
|
||||
O.show_message("<span class='warning'>[user] puts something in [target].</span>", 1)
|
||||
reagents.trans_to(target, reagents.total_volume)
|
||||
qdel(src)
|
||||
|
||||
if(target.is_open_container() != 0 && target.reagents)
|
||||
if(!target.reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is empty. Cant dissolve [src].</span>")
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notify'>You dissolve [src] in [target].</span>")
|
||||
reagents.trans_to(target, reagents.total_volume)
|
||||
for(var/mob/O in viewers(2, user))
|
||||
O.show_message("<span class='warning'>[user] puts something in [target].</span>", 1)
|
||||
spawn(5)
|
||||
qdel(src)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Pills. END
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//Pills
|
||||
// Basic set of pills below
|
||||
/obj/item/reagent_containers/food/pill/tox
|
||||
name = "Toxins pill"
|
||||
name = "\improper Toxin pill"
|
||||
desc = "Highly toxic."
|
||||
icon_state = "pill21"
|
||||
list_reagents = list("toxin" = 50)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/initropidril
|
||||
name = "initropidril pill"
|
||||
name = "\improper Initropidril pill"
|
||||
desc = "Don't swallow this."
|
||||
icon_state = "pill21"
|
||||
list_reagents = list("initropidril" = 50)
|
||||
@@ -70,85 +60,85 @@
|
||||
list_reagents = list("capulettium_plus" = 50)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/adminordrazine
|
||||
name = "Adminordrazine pill"
|
||||
name = "\improper Adminordrazine pill"
|
||||
desc = "It's magic. We don't have to explain it."
|
||||
icon_state = "pill16"
|
||||
list_reagents = list("adminordrazine" = 50)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/morphine
|
||||
name = "Morphine pill"
|
||||
name = "\improper Morphine pill"
|
||||
desc = "Commonly used to treat insomnia."
|
||||
icon_state = "pill8"
|
||||
list_reagents = list("morphine" = 30)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/methamphetamine
|
||||
name = "Methamphetamine pill"
|
||||
name = "\improper Methamphetamine pill"
|
||||
desc = "Helps improve the ability to concentrate."
|
||||
icon_state = "pill8"
|
||||
list_reagents = list("methamphetamine" = 5)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/haloperidol
|
||||
name = "Haloperidol pill"
|
||||
desc = "Haloperidol is an anti-psychotic use to treat psychiatric problems."
|
||||
name = "\improper Haloperidol pill"
|
||||
desc = "Haloperidol is an anti-psychotic used to treat psychiatric problems."
|
||||
icon_state = "pill8"
|
||||
list_reagents = list("haloperidol" = 15)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/happy
|
||||
name = "Happy pill"
|
||||
name = "happy pill"
|
||||
desc = "Happy happy joy joy!"
|
||||
icon_state = "pill18"
|
||||
list_reagents = list("space_drugs" = 15, "sugar" = 15)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/zoom
|
||||
name = "Zoom pill"
|
||||
name = "zoom pill"
|
||||
desc = "Zoooom!"
|
||||
icon_state = "pill18"
|
||||
list_reagents = list("synaptizine" = 5, "methamphetamine" = 5)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/charcoal
|
||||
name = "Charcoal pill"
|
||||
name = "\improper Charcoal pill"
|
||||
desc = "Neutralizes many common toxins."
|
||||
icon_state = "pill17"
|
||||
list_reagents = list("charcoal" = 50)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/epinephrine
|
||||
name = "Epinephrine pill"
|
||||
name = "\improper Epinephrine pill"
|
||||
desc = "Used to provide shots of adrenaline."
|
||||
icon_state = "pill6"
|
||||
list_reagents = list("epinephrine" = 50)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/salicylic
|
||||
name = "Salicylic Acid pill"
|
||||
name = "\improper Salicylic Acid pill"
|
||||
desc = "Commonly used to treat moderate pain and fevers."
|
||||
icon_state = "pill4"
|
||||
list_reagents = list("sal_acid" = 20)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/salbutamol
|
||||
name = "Salbutamol pill"
|
||||
name = "\improper Salbutamol pill"
|
||||
desc = "Used to treat respiratory distress."
|
||||
icon_state = "pill8"
|
||||
list_reagents = list("salbutamol" = 20)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/hydrocodone
|
||||
name = "Hydrocodone pill"
|
||||
name = "\improper Hydrocodone pill"
|
||||
desc = "Used to treat extreme pain."
|
||||
icon_state = "pill6"
|
||||
list_reagents = list("hydrocodone" = 15)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/calomel
|
||||
name = "calomel pill"
|
||||
name = "\improper Calomel pill"
|
||||
desc = "Can be used to purge impurities, but is highly toxic itself."
|
||||
icon_state = "pill3"
|
||||
list_reagents = list("calomel" = 15)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/mutadone
|
||||
name = "mutadone pill"
|
||||
name = "\improper Mutadone pill"
|
||||
desc = "Used to cure genetic abnormalities."
|
||||
icon_state = "pill18"
|
||||
list_reagents = list("mutadone" = 20)
|
||||
|
||||
/obj/item/reagent_containers/food/pill/mannitol
|
||||
name = "mannitol pill"
|
||||
name = "\improper Mannitol pill"
|
||||
desc = "Used to treat cranial swelling."
|
||||
icon_state = "pill19"
|
||||
list_reagents = list("mannitol" = 20)
|
||||
|
||||
Reference in New Issue
Block a user