Fixed random lipstick texture, fake syndie lipstick no longer can randomly spawn (#85880)

## About The Pull Request

Closes #85876 
Also adds a variable to blacklist lipstick from randomly spawning. While
fake lipstick doesn't apply its traits it still has its sprite and name
which could confuse players

## Changelog
🆑
fix: Fixed random lipstick texture, fake syndie lipstick no longer can
randomly spawn
/🆑
This commit is contained in:
SmArtKar
2024-08-17 15:18:28 +02:00
committed by GitHub
parent dd7be920ff
commit 2bb73bd33e
+9 -3
View File
@@ -8,6 +8,7 @@
desc = "A generic brand of lipstick."
icon = 'icons/obj/cosmetic.dmi'
icon_state = "lipstick"
base_icon_state = "lipstick"
inhand_icon_state = "lipstick"
w_class = WEIGHT_CLASS_TINY
interaction_flags_click = NEED_DEXTERITY|NEED_HANDS|ALLOW_RESTING
@@ -18,6 +19,8 @@
var/style = "lipstick"
/// A trait that's applied while someone has this lipstick applied, and is removed when the lipstick is removed
var/lipstick_trait
/// Can this lipstick spawn randomly
var/random_spawn = TRUE
/obj/item/lipstick/Initialize(mapload)
. = ..()
@@ -34,8 +37,8 @@
. += "Alt-click to change the style."
/obj/item/lipstick/update_icon_state()
icon_state = "[initial(icon_state)][open ? "_uncap" : null]"
inhand_icon_state = "[initial(icon_state)][open ? "open" : null]"
icon_state = "[base_icon_state][open ? "_uncap" : null]"
inhand_icon_state = "[base_icon_state][open ? "open" : null]"
return ..()
/obj/item/lipstick/update_overlays()
@@ -104,13 +107,16 @@
name = "\improper Kiss of Death"
desc = "An incredibly potent tube of lipstick made from the venom of the dreaded Yellow Spotted Space Lizard, as deadly as it is chic. Try not to smear it!"
lipstick_trait = TRAIT_KISS_OF_DEATH
random_spawn = FALSE
/obj/item/lipstick/syndie
name = "syndie lipstick"
desc = "Syndicate branded lipstick with a killer dose of kisses. Observe safety regulations!"
icon_state = "slipstick"
base_icon_state = "slipstick"
lipstick_color = COLOR_SYNDIE_RED
lipstick_trait = TRAIT_SYNDIE_KISS
random_spawn = FALSE
/obj/item/lipstick/random
name = "lipstick"
@@ -123,7 +129,7 @@
if(!possible_colors)
possible_colors = list()
for(var/obj/item/lipstick/lipstick_path as anything in (typesof(/obj/item/lipstick) - src.type))
if(!initial(lipstick_path.lipstick_color))
if(!initial(lipstick_path.lipstick_color) || !initial(lipstick_path.random_spawn))
continue
possible_colors[initial(lipstick_path.lipstick_color)] = initial(lipstick_path.name)
lipstick_color = pick(possible_colors)