mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +01:00
f58b8511f0
## 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. /🆑
51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
/**
|
|
*This is smoke bomb, mezum koman. It is a grenade subtype. All craftmanship is of the highest quality.
|
|
*It menaces with spikes of iron. On it is a depiction of an assistant.
|
|
*The assistant is bleeding. The assistant has a painful expression. The assistant is dead.
|
|
*/
|
|
/obj/item/grenade/smokebomb
|
|
name = "smoke grenade"
|
|
desc = "Real bruh moment if you ever see this. Probably tell a c*der or something."
|
|
icon = 'icons/obj/weapons/grenade.dmi'
|
|
icon_state = "smokewhite"
|
|
inhand_icon_state = "smoke"
|
|
slot_flags = ITEM_SLOT_BELT
|
|
///List of words we take randomly every time we're examined. It's extremely important to keep this list up to date,
|
|
///It helps to generate the insightful description of the smokebomb
|
|
var/static/list/bruh_moment = list(
|
|
"Dank",
|
|
"Hip",
|
|
"Lit",
|
|
"Based",
|
|
"Robust",
|
|
"Bruh",
|
|
"Gamer",
|
|
"Sigma",
|
|
"Blud",
|
|
"Fanum",
|
|
"Gyatt",
|
|
"Looksmaxxing",
|
|
"Mewing",
|
|
"Aura",
|
|
"Crashout",
|
|
)
|
|
|
|
///Here we generate the extremely insightful description.
|
|
/obj/item/grenade/smokebomb/Initialize(mapload)
|
|
. = ..()
|
|
desc = "The word '[pick(bruh_moment)]' is scribbled on it in crayon."
|
|
|
|
///Here we generate some smoke and also damage blobs??? for some reason. Honestly not sure why we do that.
|
|
/obj/item/grenade/smokebomb/detonate(mob/living/lanced_by)
|
|
. = ..()
|
|
if(!.)
|
|
return
|
|
|
|
update_mob()
|
|
playsound(src, 'sound/effects/smoke.ogg', 50, TRUE, -3)
|
|
do_smoke(4, src, loc, smoke_type = /datum/effect_system/fluid_spread/smoke/bad)
|
|
for(var/obj/structure/blob/blob in view(8, src))
|
|
var/damage = round(30/(get_dist(blob, src) + 1))
|
|
blob.take_damage(damage, BURN, MELEE, 0)
|
|
qdel(src)
|