Files
Ghom 0b0c5ea91e Unit test material checks are now performed on all crafting recipes by default. All stack recipes now transfer mats to the results (#92620)
## About The Pull Request
Extends the part of the crafting unit test that ensures consistency
between the total mats of the components of a recipe (or rather, the
result of said recipe) and a generic instance of the same type as its
result, previously only implemented on food recipes.

## Why It's Good For The Game
This ensures a degree of consistency with the material composition of
various objects in the game. I couldn't do it in the original PR as that
one was too big already and it took months to get it merged, and have
the relative bugs fixed.

Currently a WIP as I slowly deal with the unit test reports.

## Changelog

🆑
refactor: Follow-up to the crafting/material refactor from months ago.
All objects crafted with stacks now inherit their mat composition (not
necessarily the effects and color) by default, while previously only a
few things like chair, sinks and toilets did. Report any object looking
or behaving weirdly as a result.
fix: The material composition of ammo boxes is no longer a 1/10 of what
it's supposed to be. It was a shitty hack to make it harder to recycle
empty ammo boxes. Instead, they lose materials as they're emptied now.
/🆑
2025-12-02 18:29:01 -05:00

97 lines
5.1 KiB
Plaintext

/obj/item/key
name = "key"
desc = "A small grey key."
icon = 'icons/mob/rideables/vehicles.dmi'
icon_state = "key"
w_class = WEIGHT_CLASS_TINY
/obj/item/key/atv
name = "ATV key"
desc = "A small grey key for starting and operating ATVs."
/obj/item/key/security
desc = "A keyring with a small steel key, and a rubber stun baton accessory."
icon_state = "keysec"
/obj/item/key/security/suicide_act(mob/living/carbon/user)
if(!user.emote("spin")) //In the off chance that someone attempts this suicide while under the effects of mime's bane they deserve the silliness.
user.visible_message(span_suicide("[user] is putting \the [src] in [user.p_their()] ear and starts [user.p_their()] motor! It looks like [user.p_theyre()] trying to commit suicide... But [user.p_they()] sputters and stalls out! "))
playsound(src, 'sound/misc/sadtrombone.ogg', 50, TRUE, -1)
return SHAME
user.visible_message(span_suicide("[user] is putting \the [src] in [user.p_their()] ear and starts [user.p_their()] motor! It looks like [user.p_theyre()] trying to commit suicide!"))
user.say("Vroom vroom!!", forced="secway key suicide") //Not doing a shamestate here, because even if they fail to speak they're spinning.
addtimer(CALLBACK(user, TYPE_PROC_REF(/mob/living/, gib)), 2 SECONDS)
return MANUAL_SUICIDE
/obj/item/key/janitor
desc = "A keyring with a small steel key, and a pink fob reading \"Pussy Wagon\"."
icon_state = "keyjanitor"
icon_angle = 90
force = 2
w_class = WEIGHT_CLASS_SMALL
throwforce = 9
hitsound = SFX_SWING_HIT
attack_verb_continuous = list("stubs", "pokes")
attack_verb_simple = list("stub", "poke")
sharpness = SHARP_EDGED
embed_type = /datum/embedding/janicart_key
wound_bonus = -1
exposed_wound_bonus = 2
/datum/embedding/janicart_key
pain_mult = 1
embed_chance = 30
fall_chance = 70
/obj/item/key/janitor/suicide_act(mob/living/carbon/user)
switch(user.mind?.get_skill_level(/datum/skill/cleaning))
if(SKILL_LEVEL_NONE to SKILL_LEVEL_NOVICE) //Their mind is too weak to ascend as a janny
user.visible_message(span_suicide("[user] is putting \the [src] in [user.p_their()] mouth and is trying to become one with the janicart, but has no idea where to start! It looks like [user.p_theyre()] trying to commit suicide!"))
user.gib(DROP_ALL_REMAINS)
return MANUAL_SUICIDE
if(SKILL_LEVEL_APPRENTICE to SKILL_LEVEL_JOURNEYMAN) //At least they tried
user.visible_message(span_suicide("[user] is putting \the [src] in [user.p_their()] mouth and has inefficiently become one with the janicart! It looks like [user.p_theyre()] trying to commit suicide!"))
user.AddElement(/datum/element/cleaning)
addtimer(CALLBACK(src, PROC_REF(manual_suicide), user), 5.1 SECONDS)
return MANUAL_SUICIDE
if(SKILL_LEVEL_EXPERT to SKILL_LEVEL_MASTER) //They are worthy enough, but can it go even further beyond?
user.visible_message(span_suicide("[user] is putting \the [src] in [user.p_their()] mouth and has skillfully become one with the janicart! It looks like [user.p_theyre()] trying to commit suicide!"))
user.AddElement(/datum/element/cleaning)
for(var/i in 1 to 100)
addtimer(CALLBACK(user, TYPE_PROC_REF(/atom, add_atom_colour), (i % 2)? "#a245bb" : "#7a7d82", ADMIN_COLOUR_PRIORITY), i)
addtimer(CALLBACK(src, PROC_REF(manual_suicide), user), 101)
return MANUAL_SUICIDE
if(SKILL_LEVEL_LEGENDARY to INFINITY) //Holy shit, look at that janny go!
user.visible_message(span_suicide("[user] is putting \the [src] in [user.p_their()] mouth and has epically become one with the janicart, and they're even in overdrive mode! It looks like [user.p_theyre()] trying to commit suicide!"))
user.AddElement(/datum/element/cleaning)
playsound(src, 'sound/effects/magic/lightning_chargeup.ogg', 50, TRUE, -1)
user.reagents.add_reagent(/datum/reagent/drug/methamphetamine, 10) //Gotta go fast!
for(var/i in 1 to 150)
addtimer(CALLBACK(user, TYPE_PROC_REF(/atom, add_atom_colour), (i % 2)? "#a245bb" : "#7a7d82", ADMIN_COLOUR_PRIORITY), i)
addtimer(CALLBACK(src, PROC_REF(manual_suicide), user), 151)
return MANUAL_SUICIDE
/obj/item/key/proc/manual_suicide(mob/living/user)
if(user)
user.remove_atom_colour(ADMIN_COLOUR_PRIORITY)
user.visible_message(span_suicide("[user] forgot [user.p_they()] isn't actually a janicart! That's a paddlin'!"))
if(user.mind?.get_skill_level(/datum/skill/cleaning) >= SKILL_LEVEL_LEGENDARY) //Janny janny janny janny janny
playsound(src, 'sound/effects/adminhelp.ogg', 50, TRUE, -1)
user.adjust_oxy_loss(200)
user.death(FALSE)
/obj/item/key/lasso
name = "bone lasso"
desc = "The perfect tool for directing a Goliath! If only it made them move any faster..."
force = 12
icon_state = "lasso"
inhand_icon_state = "chain"
worn_icon_state = "whip"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
attack_verb_continuous = list("flogs", "whips", "lashes", "disciplines")
attack_verb_simple = list("flog", "whip", "lash", "discipline")
hitsound = 'sound/items/weapons/whip.ogg'
slot_flags = ITEM_SLOT_BELT
custom_materials = list(/datum/material/bone = SHEET_MATERIAL_AMOUNT)