Files
SmArtKar f58b8511f0 Refactors effect_system (#94999)
## About The Pull Request

This PR refactors ``effect_system``s to be a bit easier to use by
getting rid of ``set_up``, allowing ``attach()`` to be chained into
``start()`` and refactoring most direct system usages in our code to use
helper procs.

``set_up`` was unnecessary and only existed to allow ``New``'s behavior
to be fully overriden, which is not required if we split
sparks/lightning/steam into a new ``/datum/effect_system/basic`` subtype
which houses the effect spreading behavior. This allows us to roll all
logic from ``set_up`` into ``New`` and cut down on code complexity.
Chaining setup as ``system.attach(src).start()`` also helps a bit in
case no helper method exists

I've added ``do_chem_smoke`` and ``do_foam`` helpers, which respectively
allow chemical smoke or foam to be spawned easily without having to
manually create effect datums and reagent holders.

Also turns out we've had some nonfunctional effect systems which either
never set themselves up, or never started, so I fixed those while I was
at it (mostly by moving them to aforementioned helper procs)

## Why It's Good For The Game

Cleaner code, makes it significantly easier for users to work with. Also
most of our effect system usage was copypasta which was passing booleans
as numbers, while perfectly fine helper procs existed in our code.

## Changelog
🆑
refactor: Refactored sparks, foam, smoke, and other miscellaneous effect
systems.
refactor: Vapes now have consistent rigging with cigs using the new
system.
fix: Fixed some effects never working.
/🆑
2026-02-03 22:23:09 -05:00

76 lines
2.6 KiB
Plaintext

/obj/item/seeds/onion
name = "onion seed pack"
desc = "These seeds grow into onions."
icon_state = "seed-onion"
species = "onion"
plantname = "Onion Sprouts"
product = /obj/item/food/grown/onion
lifespan = 20
maturation = 3
production = 4
yield = 6
endurance = 25
instability = 10
growthstages = 3
weed_chance = 3
growing_icon = 'icons/obj/service/hydroponics/growing_vegetables.dmi'
reagents_add = list(/datum/reagent/consumable/nutriment/vitamin = 0.04, /datum/reagent/consumable/nutriment = 0.1, /datum/reagent/consumable/tearjuice = 0.25)
mutatelist = list(/obj/item/seeds/onion/red)
/obj/item/food/grown/onion
seed = /obj/item/seeds/onion
name = "onion"
desc = "Nothing to cry over."
icon_state = "onion"
tastes = list("onions" = 1)
wine_power = 30
foodtypes = VEGETABLES
/obj/item/food/grown/onion/make_processable()
AddElement(/datum/element/processable, TOOL_KNIFE, /obj/item/food/onion_slice, 2, 15, screentip_verb = "Cut")
/obj/item/seeds/onion/red
name = "red onion seed pack"
desc = "For growing exceptionally potent onions."
icon_state = "seed-onionred"
species = "onion_red"
plantname = "Red Onion Sprouts"
weed_chance = 1
product = /obj/item/food/grown/onion/red
mutatelist = null
/obj/item/food/grown/onion/red
seed = /obj/item/seeds/onion/red
name = "red onion"
desc = "Purple despite the name."
icon_state = "onion_red"
wine_power = 60
/obj/item/food/grown/onion/red/make_processable()
AddElement(/datum/element/processable, TOOL_KNIFE, /obj/item/food/onion_slice/red, 2, 15, screentip_verb = "Cut")
/obj/item/food/grown/onion/UsedforProcessing(mob/living/user, obj/item/I, list/chosen_option, list/created_atoms)
var/splat_location = get_turf(src) //we need to set up the smoke beforehand
do_chem_smoke(0, src, splat_location, carry = reagents, silent = FALSE)
return ..()
/obj/item/food/onion_slice
name = "onion slice"
desc = "Ring, not for wearing."
icon_state = "onionslice"
food_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 2)
w_class = WEIGHT_CLASS_TINY
foodtypes = VEGETABLES
/obj/item/food/onion_slice/make_bakeable()
AddComponent(/datum/component/bakeable, /obj/item/food/onionrings, rand(15 SECONDS, 20 SECONDS), TRUE, TRUE)
/obj/item/food/onion_slice/make_microwaveable()
AddElement(/datum/element/microwavable, /obj/item/food/onionrings)
/obj/item/food/onion_slice/red
name = "red onion slice"
desc = "It shines like an exceptionally low quality amethyst."
icon_state = "onionslice_red"
food_reagents = list(/datum/reagent/consumable/nutriment = 5, /datum/reagent/consumable/nutriment/vitamin = 2, /datum/reagent/consumable/tearjuice = 2.5)