mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Custom patch icons for ChemMaster (#29206)
* custom patches * item state ruins context menu's sprite
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#define MAX_PILL_SPRITE 20 //max icon state of the pill sprites
|
||||
#define MAX_PATCH_SPRITE 21 //max icon state of the patch sprites
|
||||
#define MAX_CUSTOM_NAME_LEN 64 // Max length of a custom pill/condiment/whatever
|
||||
|
||||
#define CUSTOM_NAME_DISABLED null
|
||||
@@ -595,7 +596,7 @@
|
||||
/datum/chemical_production_mode/pills/New()
|
||||
. = ..()
|
||||
sprites = list()
|
||||
for(var/i = 1 to MAX_PILL_SPRITE)
|
||||
for(var/i in 1 to MAX_PILL_SPRITE)
|
||||
sprites += list("pill[i]")
|
||||
|
||||
/datum/chemical_production_mode/patches
|
||||
@@ -612,7 +613,13 @@
|
||||
"spaceacillin", "salglu_solution", "sal_acid", "cryoxadone", "blood", "synthflesh", "hydrocodone",
|
||||
"mitocholide", "rezadone", "menthol", "diphenhydramine", "ephedrine", "iron", "sanguine_reagent")
|
||||
|
||||
/datum/chemical_production_mode/patches/proc/SafetyCheck(datum/reagents/R)
|
||||
/datum/chemical_production_mode/patches/New()
|
||||
. = ..()
|
||||
sprites = list()
|
||||
for(var/i in 1 to MAX_PATCH_SPRITE)
|
||||
sprites += list("bandaid[i]")
|
||||
|
||||
/datum/chemical_production_mode/patches/proc/safety_check(datum/reagents/R)
|
||||
for(var/datum/reagent/A in R.reagent_list)
|
||||
if(!safe_chem_list.Find(A.id))
|
||||
return FALSE
|
||||
@@ -621,15 +628,15 @@
|
||||
return TRUE
|
||||
|
||||
/datum/chemical_production_mode/patches/configure_item(data, datum/reagents/R, obj/item/reagent_containers/patch/P)
|
||||
. = ..()
|
||||
var/chemicals_is_safe = data["chemicals_is_safe"]
|
||||
|
||||
if(isnull(chemicals_is_safe))
|
||||
chemicals_is_safe = SafetyCheck(R)
|
||||
chemicals_is_safe = safety_check(R)
|
||||
data["chemicals_is_safe"] = chemicals_is_safe
|
||||
|
||||
if(chemicals_is_safe)
|
||||
P.instant_application = TRUE
|
||||
P.icon_state = "bandaid_med"
|
||||
|
||||
/datum/chemical_production_mode/bottles
|
||||
mode_id = "chem_bottles"
|
||||
@@ -667,6 +674,7 @@
|
||||
return reagents.get_master_reagent_name()
|
||||
|
||||
#undef MAX_PILL_SPRITE
|
||||
#undef MAX_PATCH_SPRITE
|
||||
#undef MAX_CUSTOM_NAME_LEN
|
||||
|
||||
#undef CUSTOM_NAME_DISABLED
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
"spaceacillin" = image(icon = 'icons/obj/decals.dmi', icon_state = "bio"),
|
||||
"charcoal" = image(icon = 'icons/obj/chemical.dmi', icon_state = "pill17"),
|
||||
"hydrocodone" = image(icon = 'icons/obj/chemical.dmi', icon_state = "bottle19"),
|
||||
"styptic_powder" = image(icon = 'icons/obj/chemical.dmi', icon_state = "bandaid_brute"),
|
||||
"styptic_powder" = image(icon = 'icons/obj/chemical.dmi', icon_state = "bandaid2"),
|
||||
"salbutamol" = image(icon = 'icons/obj/chemical.dmi', icon_state = "pill8"),
|
||||
"sal_acid" = image(icon = 'icons/obj/chemical.dmi', icon_state = "pill4"),
|
||||
"syndicate_nanites" = image(icon = 'icons/obj/decals.dmi', icon_state = "greencross"),
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
name = "chemical patch"
|
||||
desc = "A chemical patch for touch based applications."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bandaid"
|
||||
item_state = "bandaid"
|
||||
icon_state = "bandaid1"
|
||||
possible_transfer_amounts = null
|
||||
visible_transfer_rate = FALSE
|
||||
volume = 30
|
||||
@@ -56,47 +55,48 @@
|
||||
/obj/item/reagent_containers/patch/styptic
|
||||
name = "brute patch"
|
||||
desc = "Helps with brute injuries."
|
||||
icon_state = "bandaid_brute"
|
||||
icon_state = "bandaid2"
|
||||
instant_application = TRUE
|
||||
list_reagents = list("styptic_powder" = 30)
|
||||
|
||||
/obj/item/reagent_containers/patch/styptic/small
|
||||
name = "brute mini-patch"
|
||||
icon_state = "bandaid_brute_small"
|
||||
icon_state = "bandaid3"
|
||||
list_reagents = list("styptic_powder" = 15)
|
||||
|
||||
/obj/item/reagent_containers/patch/silver_sulf
|
||||
name = "burn patch"
|
||||
desc = "Helps with burn injuries."
|
||||
icon_state = "bandaid_burn"
|
||||
icon_state = "bandaid4"
|
||||
instant_application = TRUE
|
||||
list_reagents = list("silver_sulfadiazine" = 30)
|
||||
|
||||
/obj/item/reagent_containers/patch/silver_sulf/small
|
||||
name = "burn mini-patch"
|
||||
icon_state = "bandaid_burn_small"
|
||||
icon_state = "bandaid5"
|
||||
list_reagents = list("silver_sulfadiazine" = 15)
|
||||
|
||||
/obj/item/reagent_containers/patch/synthflesh
|
||||
name = "synthflesh patch"
|
||||
desc = "Helps with brute and burn injuries."
|
||||
icon_state = "bandaid_med"
|
||||
icon_state = "bandaid20"
|
||||
instant_application = TRUE
|
||||
list_reagents = list("synthflesh" = 10)
|
||||
|
||||
/obj/item/reagent_containers/patch/nicotine
|
||||
name = "nicotine patch"
|
||||
desc = "Helps temporarily curb the cravings of nicotine dependency."
|
||||
icon_state = "bandaid15"
|
||||
list_reagents = list("nicotine" = 10)
|
||||
|
||||
/obj/item/reagent_containers/patch/jestosterone
|
||||
name = "jestosterone patch"
|
||||
desc = "Helps with brute injuries if the affected person is a clown, otherwise inflicts various annoying effects."
|
||||
icon_state = "bandaid_clown"
|
||||
icon_state = "bandaid21"
|
||||
list_reagents = list("jestosterone" = 20)
|
||||
|
||||
/obj/item/reagent_containers/patch/perfluorodecalin
|
||||
name = "perfluorodecalin patch"
|
||||
desc = "Incredibly potent respiratory aid drug, may cause shortness of breath if used in large amounts."
|
||||
icon_state = "bandaid_med"
|
||||
icon_state = "bandaid12"
|
||||
list_reagents = list("perfluorodecalin" = 10)
|
||||
|
||||
Reference in New Issue
Block a user