Files
FalloutFalconandGitHub d2f34e33be moves abstract_type up to datum, spawners wont spawn them (#92909)
## About The Pull Request
moves all implementations (im aware of) for "Im a parent type dont spawn
me please" to the datum layer to standardized behavior
adds a standerized proc for filtering out "bad" items that we dont want
spawning. applies to it the subtype vendor, gifts, and a new spawner and
mystery box for a random gun (neither playerfacing)
"port" of https://github.com/shiptest-ss13/Shiptest/pull/4621



https://github.com/user-attachments/assets/22f6f0b2-b44e-411a-b3dc-6b97dc0287aa

small warning: I dont have EVERY abstract type defined right now but,
ive done a good enough job for now. Im tired of data entry rn
## Why It's Good For The Game
standardizing behavior. Might be a micro hit to performance however

having this lets us not rely on icon state to determine whether
something is a parent type and makes it much easier to tell something is
a parent type (could be applied further to things like admin spawning
menus and things like that).

need feedback on if this is actually good for the game.
## Changelog
🆑
add: Soda cans show up in the silver slime drink table.
add: Examine tag for items that are not mean to show up ingame.
refactor: Standardizes how gifts rule out abstract types.
fix: gifts no longer check if something has an inhand, massively
expanding the list of potential items.
/🆑
2025-09-13 00:36:15 +02:00

91 lines
3.2 KiB
Plaintext

/obj/item/clothing/gloves
name = "gloves"
gender = PLURAL //Carn: for grammarically correct text-parsing
w_class = WEIGHT_CLASS_SMALL
icon = 'icons/obj/clothing/gloves.dmi'
inhand_icon_state = "greyscale_gloves"
lefthand_file = 'icons/mob/inhands/clothing/gloves_lefthand.dmi'
righthand_file = 'icons/mob/inhands/clothing/gloves_righthand.dmi'
abstract_type = /obj/item/clothing/gloves
greyscale_colors = null
greyscale_config_inhand_left = /datum/greyscale_config/gloves_inhand_left
greyscale_config_inhand_right = /datum/greyscale_config/gloves_inhand_right
siemens_coefficient = 0.5
body_parts_covered = HANDS
slot_flags = ITEM_SLOT_GLOVES
drop_sound = 'sound/items/handling/glove_drop.ogg'
pickup_sound = 'sound/items/handling/glove_pick_up.ogg'
attack_verb_continuous = list("challenges")
attack_verb_simple = list("challenge")
strip_delay = 2 SECONDS
equip_delay_other = 4 SECONDS
article = "a pair of"
// Path variable. If defined, will produced the type through interaction with wirecutters.
var/cut_type = null
/// Used for handling bloody gloves leaving behind bloodstains on objects. Will be decremented whenever a bloodstain is left behind, and be incremented when the gloves become bloody.
var/transfer_blood = 0
/obj/item/clothing/gloves/apply_fantasy_bonuses(bonus)
. = ..()
siemens_coefficient = modify_fantasy_variable("siemens_coefficient", siemens_coefficient, -bonus / 10)
/obj/item/clothing/gloves/remove_fantasy_bonuses(bonus)
siemens_coefficient = reset_fantasy_variable("siemens_coefficient", siemens_coefficient)
return ..()
/obj/item/clothing/gloves/wash(clean_types)
. = ..()
if((clean_types & CLEAN_TYPE_BLOOD) && transfer_blood > 0)
transfer_blood = 0
. |= COMPONENT_CLEANED|COMPONENT_CLEANED_GAIN_XP
/obj/item/clothing/gloves/suicide_act(mob/living/carbon/user)
user.visible_message(span_suicide("\the [src] are forcing [user]'s hands around [user.p_their()] neck! It looks like the gloves are possessed!"))
return OXYLOSS
/obj/item/clothing/gloves/worn_overlays(mutable_appearance/standing, isinhands = FALSE)
. = ..()
if(isinhands)
return
if(damaged_clothes)
. += mutable_appearance('icons/effects/item_damage.dmi', "damagedgloves")
/obj/item/clothing/gloves/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands, icon_file)
. = ..()
if (isinhands)
return
var/blood_overlay = get_blood_overlay("glove")
if (blood_overlay)
. += blood_overlay
/obj/item/clothing/gloves/update_clothes_damaged_state(damaged_state = CLOTHING_DAMAGED)
..()
if(ismob(loc))
var/mob/M = loc
M.update_worn_gloves()
/obj/item/clothing/gloves/proc/can_cut_with(obj/item/tool)
if(!cut_type)
return FALSE
if(icon_state != initial(icon_state))
return FALSE // We don't want to cut dyed gloves.
return TRUE
/obj/item/clothing/gloves/attackby(obj/item/tool, mob/user, list/modifiers, list/attack_modifiers)
. = ..()
if(.)
return
if(tool.tool_behaviour != TOOL_WIRECUTTER && !tool.get_sharpness())
return
if (!can_cut_with(tool))
return
balloon_alert(user, "cutting off fingertips...")
if(!do_after(user, 3 SECONDS, target=src, extra_checks = CALLBACK(src, PROC_REF(can_cut_with), tool)))
return
balloon_alert(user, "cut fingertips off")
qdel(src)
user.put_in_hands(new cut_type)
return TRUE