Skip to content

Commit

Permalink
confetti system
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasint committed Nov 9, 2023
1 parent 22c719d commit 4187226
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
5 changes: 5 additions & 0 deletions code/controllers/subsystem/processing/fastprocess.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ PROCESSING_SUBSYSTEM_DEF(fastprocess)
name = "Fast Processing"
wait = 0.2 SECONDS
stat_tag = "FP"

PROCESSING_SUBSYSTEM_DEF(actualfastprocess)
name = "Actual Fast Processing"
wait = 0.1 SECONDS
stat_tag = "AFP"
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
src.lifetime = lifetime
source_object = parent

START_PROCESSING(SSfastprocess, src)
START_PROCESSING(SSactualfastprocess, src)

if(lifetime)
addtimer(CALLBACK(src, PROC_REF(kill_it_with_fire)), lifetime)

/datum/component/particle_spewer/Destroy(force, silent)
. = ..()
STOP_PROCESSING(SSfastprocess, src)
STOP_PROCESSING(SSactualfastprocess, src)
for(var/atom/listed_atom as anything in living_particles + dead_particles)
qdel(listed_atom)
living_particles = null
Expand All @@ -69,7 +69,7 @@

for(var/i = 0 to burst_amount)
//create and assign particle its stuff
var/obj/effect/abstract/particle/spawned = new(source_object.loc)
var/obj/effect/abstract/particle/spawned = new(get_turf(source_object))
spawned.pixel_x = offset_x
spawned.pixel_y = offset_y
spawned.icon = icon_file
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/datum/component/particle_spewer/confetti/animate_particle(obj/effect/abstract/particle/spawned)
var/matrix/first = matrix()
var/matrix/second = matrix()

spawned.blend_mode = BLEND_ADD
spawned.pixel_x += rand(-3,3)
spawned.pixel_y += rand(-3,3)

first.Turn(rand(-90, 90))
first.Scale(0.5,0.5)
second.Turn(rand(-90, 90))

spawned.color = rgb(rand(1, 255), rand(1, 255), rand(1, 255))

animate(spawned, transform = first, time = 0.4 SECONDS, pixel_y = rand(-32, 32) + spawned.pixel_y, pixel_x = rand(-32, 32) + spawned.pixel_x, easing = LINEAR_EASING)
animate(transform = second, time = 0.5 SECONDS, alpha = 0, pixel_y = spawned.pixel_y - 5, easing = LINEAR_EASING|EASE_OUT)

/obj/item/debug_confetti/Initialize(mapload)
. = ..()
AddComponent(/datum/component/particle_spewer/confetti, 10 SECONDS, burst_amount = 5)
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6342,6 +6342,7 @@
#include "monkestation\code\modules\surgery\organs\internal\stomach.dm"
#include "monkestation\code\modules\surgery\organs\internal\tongue.dm"
#include "monkestation\code\modules\trading\unusual_effects\animation_housing\_spawning_component.dm"
#include "monkestation\code\modules\trading\unusual_effects\animation_housing\confetti.dm"
#include "monkestation\code\modules\twitch_bits\admin_command.dm"
#include "monkestation\code\modules\twitch_bits\twitch_system.dm"
#include "monkestation\code\modules\twitch_bits\events\amongus.dm"
Expand Down

0 comments on commit 4187226

Please sign in to comment.