Files
VOREStation/code/modules/makeup/nailpolish.dm
T
Cameron Lennox d5849910e5 Begin clickcode attack_self fix (#18797)
* Begin clickcode attack_self fix

Begins the work to make everything call back to parent for attack_self so that signals are sacred.

* Makes MORE things call the attack_self() parent

Yes, I could make special_handling a var on obj/item HOWEVER i want it to be specific so it can be tracked down later and ONLY the objects that use it can be refactored instead of sitting there literally forever and it just becoming 'a thing'.

* Finishes making the rest of attack_self call parent.

As mentioned, things such as 'specialty_goggles' 'special_handling' and the such are only there to help with attack_self until the attack_self is recoded for those items.

* begone foul demon

* some more cleanup

* These

* GOD this was annoying

* yeh

* Fix this

* fLARES

* Thesee too

* toys!

* Even more!

* More fixes

* Even more

* rest of em

* these too

* Update syndie.dm

* hardref clear

* Update code/game/gamemodes/nuclear/pinpointer.dm

* Update code/game/objects/effects/mines.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/contraband_vr.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/weapons/gift_wrappaper.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* these too

* Update maintpanel_stack.dm

* angry warning

* Fixes packaged snacks.

Fixes improper var default.

* Special handling for these

* proper poly types

* Fixes magclaws

Makes the 'features' it had just part  of base magboots that can be adjusted via varswap.

* Fixes jackets

Fixes https://github.com/VOREStation/VOREStation/issues/18941

* Small bugfix

Makes p_Theyre properly capitialize
Makes examine show proper wording

* Update gift_wrappaper.dm
2025-12-29 13:21:10 -05:00

152 lines
4.9 KiB
Plaintext

/obj/item/organ/external/var/datum/nail_polish/nail_polish
/obj/item/nailpolish
name = "nail polish"
desc = "to paint your nails with. Or someone else's!"
icon = 'icons/obj/nailpolish_vr.dmi'
icon_state = "nailpolish"
w_class = ITEMSIZE_SMALL
var/colour = "#FFFFFF"
var/image/top_underlay
var/image/color_underlay
var/open = FALSE
drop_sound = 'sound/items/drop/glass.ogg'
pickup_sound = 'sound/items/pickup/glass.ogg'
/obj/item/nailpolish/Initialize(mapload)
. = ..()
desc = "<font color='[colour]'>Nail polish,</font> " + initial(desc)
top_underlay = image(icon, "top")
color_underlay = image(icon, "color")
update_icon()
/obj/item/nailpolish/proc/set_colour(var/_colour)
colour = _colour
desc = "<font color='[colour]'>Nail polish,</font> " + initial(desc)
update_icon()
/obj/item/nailpolish/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
open = !open
to_chat(user, span_notice("You [open ? "open" : "close"] \the [src]."))
update_icon()
/obj/item/nailpolish/update_icon()
. = ..()
icon_state = "[initial(icon_state)][open ? "-open" : ""]"
top_underlay.icon_state = "top[open ? "-open" : ""]"
color_underlay.icon_state = "color[open ? "-open" : ""]"
color_underlay.color = colour
underlays = list(color_underlay, top_underlay)
/obj/item/organ/external/proc/get_polish(var/colour)
var/static/forbidden_parts = BP_ALL - list(BP_L_HAND, BP_R_HAND, BP_L_FOOT, BP_R_FOOT)
if(organ_tag in forbidden_parts)
return FALSE
var/ico
var/icostate
if(length(markings))
for(var/mark_name in markings)
var/mark_data = markings[mark_name]
var/datum/sprite_accessory/marking/mark = mark_data["datum"]
if(length(mark.body_parts & forbidden_parts))
continue
ico = mark.icon
icostate = "[mark.icon_state]-[organ_tag]"
break
else
ico = 'icons/obj/nailpolish_vr.dmi'
icostate = organ_tag
return new /datum/nail_polish(ico, icostate, colour)
/obj/item/nailpolish/attack(var/mob/user, var/mob/living/carbon/human/target)
if(!open)
return
if(!istype(target))
return
var/bp = user.zone_sel.selecting
var/obj/item/organ/external/body_part = target.get_organ(bp)
if(!body_part)
to_chat(user, span_warning("[target] is missing that limb!"))
return
if(body_part.nail_polish)
to_chat(user, span_notice("[target]'s [body_part.name] already has nail polish on!"))
return
var/datum/nail_polish/polish = body_part.get_polish(colour)
if(!polish)
to_chat(user, span_notice("You can't find any nails on [body_part] to paint."))
return
if(user == target)
user.visible_message(span_infoplain(span_bold("\The [user]") + " paints their nails with \the [src]."), span_infoplain("You paint your nails with \the [src]."))
else
if(do_after(user, 2 SECONDS, target))
user.visible_message(span_infoplain(span_bold("\The [user]") + " paints \the [target]'s nails with \the [src]."), span_infoplain("You paint \the [target]'s nails with \the [src]."))
else
to_chat(user, span_notice("Both you and [target] must stay still!"))
return
body_part.set_polish(polish)
/obj/item/organ/external/proc/set_polish(var/datum/nail_polish/polish)
nail_polish = polish
owner?.update_icons_body()
/obj/item/nailpolish_remover
name = "nail polish remover"
desc = "Paint thinner, acetone, nail polish remover; whatever you call it, it gets the job done."
drop_sound = 'sound/items/drop/helm.ogg'
pickup_sound = 'sound/items/pickup/helm.ogg'
icon = 'icons/obj/nailpolish_vr.dmi'
icon_state = "nailpolishremover"
var/open = FALSE
/obj/item/nailpolish_remover/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
open = !open
to_chat(user, span_notice("You [open ? "open" : "close"] \the [src]."))
update_icon()
/obj/item/nailpolish_remover/update_icon()
. = ..()
icon_state = "[initial(icon_state)][open ? "-open" : ""]"
/obj/item/nailpolish_remover/attack(var/mob/user, var/mob/living/carbon/human/target)
if(!open)
return
if(!istype(target))
return
var/bp = user.zone_sel.selecting
var/obj/item/organ/external/body_part = target.get_organ(bp)
if(!body_part)
to_chat(user, span_warning("[target] is missing that limb!"))
return
if(!body_part.nail_polish)
to_chat(user, span_notice("[target]'s [body_part.name] has no nail polish to remove!"))
return
if(user == target)
user.visible_message(span_infoplain(span_bold("\The [user]") + " removes their nail polish with \the [src]."), span_infoplain("You remove your nail polish with \the [src]."))
else
if(do_after(user, 2 SECONDS, target))
user.visible_message(span_infoplain(span_bold("\The [user]") + " removes \the [target]'s nail polish with \the [src]."), span_infoplain("You remove \the [target]'s nail polish with \the [src]."))
else
to_chat(user, span_notice("Both you and [target] must stay still!"))
return
body_part.set_polish(null)
/datum/nail_polish
var/icon = 'icons/obj/nailpolish_vr.dmi'
var/icon_state
var/color
/datum/nail_polish/New(var/_icon, var/_icon_state, var/_color)
icon = _icon
icon_state = _icon_state
color = _color