Files
Paradise/code/game/objects/effects/effect_system/effect_system.dm
BiancaWilkson 20b4586db4 Reworks smoke (And adds hotbox mechanics) (#24993)
* hi snoop dogg

* it compiles now

* toilet bong real

* atomicity who??? this var name made me mad

* still needs testing

* im not gonna be responsible for a lag machine

* I was doing this in a kinda dumb way

* cigarettes no longer OD everyone around you

* toilet rework

* there is now a global limit

* this is technically a very very niche exploit fix

* lmao

* Update code/modules/hydroponics/grown.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/objects/effects/effect_system/effects_smoke.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

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

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/objects/effects/effect_system/effects_smoke.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* AGONY

Co-authored-by: synthtee <127706731+SynthTwo@users.noreply.github.com>

* untested code lol

* Changes coughing logic

* Small amount of logging

* cough cough cough cough cough

* oh lol

* oh thats how color works

* Update code/modules/hydroponics/grown.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

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

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/objects/effects/effect_system/effects_smoke.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/objects/effects/effect_system/effects_smoke.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* haters dont want to see plumes of smoke all over the station

* DGL review pt 1

* DGL review pt 2

* removes unneeded var

* Update code/game/objects/effects/effect_system/effects_smoke.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/objects/effects/effect_system/effects_smoke.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/objects/effects/effect_system/effects_smoke.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/objects/effects/effect_system/effects_smoke.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/game/objects/structures/watercloset.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* DGL quick review

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Uses initialize instead of new

* Remove unused var

* OH THIS IS WHAT HE MEANT

* when the space is white

* Apply suggestions from code review

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

---------

Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: synthtee <127706731+SynthTwo@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
2024-06-01 00:10:12 +00:00

75 lines
2.0 KiB
Plaintext

/* This is an attempt to make some easily reusable "particle" type effect, to stop the code
constantly having to be rewritten. An item like the jetpack that uses the ion_trail_follow system, just has one
defined, then set up when it is created with New(). Then this same system can just be reused each time
it needs to create more trails.A beaker could have a steam_trail_follow system set up, then the steam
would spawn and follow the beaker, even if it is carried or thrown.
*/
/obj/effect/particle_effect
name = "particle effect"
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
pass_flags = PASSTABLE | PASSGRILLE
/obj/effect/particle_effect/New()
..()
if(SSticker)
GLOB.cameranet.updateVisibility(src)
/obj/effect/particle_effect/Destroy()
if(SSticker)
GLOB.cameranet.updateVisibility(src)
return ..()
/datum/effect_system
///The number of objects the effect system will spawn
var/number = 3
var/cardinals = 0
var/turf/location
var/atom/holder
var/effect_type
var/total_effects = 0
var/autocleanup = FALSE //will delete itself after use
/datum/effect_system/Destroy()
holder = null
location = null
return ..()
/datum/effect_system/proc/set_up(amount = 3, only_cardinals = FALSE, source)
number = clamp(amount, amount, 10)
cardinals = only_cardinals
location = get_turf(source)
/datum/effect_system/proc/attach(atom/atom)
holder = atom
/datum/effect_system/proc/start()
if(QDELETED(src))
return
for(var/i in 1 to number)
if(total_effects > 20)
return
INVOKE_ASYNC(src, PROC_REF(generate_effect))
/datum/effect_system/proc/generate_effect()
if(holder)
location = get_turf(holder)
var/obj/effect/E = new effect_type(location)
total_effects++
var/direction
if(cardinals)
direction = pick(GLOB.cardinal)
else
direction = pick(GLOB.alldirs)
var/steps_amt = pick(1,2,3)
for(var/j in 1 to steps_amt)
sleep(5)
step(E,direction)
if(!QDELETED(src))
addtimer(CALLBACK(src, PROC_REF(decrement_total_effect)), 20)
/datum/effect_system/proc/decrement_total_effect()
total_effects--
if(autocleanup && total_effects <= 0)
qdel(src)