Skip to content

Commit

Permalink
[MIRROR] Particles stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
juxjux9930 authored and SuhEugene committed Sep 21, 2023
1 parent 5d4503b commit 315943b
Show file tree
Hide file tree
Showing 10 changed files with 199 additions and 85 deletions.
16 changes: 6 additions & 10 deletions code/__defines/_renderer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -299,22 +299,18 @@ GLOBAL_LIST_EMPTY(zmimic_renderers)
vis_contents -= gas_heat_object

if (quality == GLOB.PREF_LOW)
if(!istype(gas_heat_object, /obj/effect/heat))
QDEL_NULL(gas_heat_object)
gas_heat_object = new /obj/effect/heat(null)
QDEL_NULL(gas_heat_object)
gas_heat_object = new /obj/effect/heat(null)
else
if(!istype(gas_heat_object, /obj/particle_emitter/heat))
QDEL_NULL(gas_heat_object)
gas_heat_object = new /obj/particle_emitter/heat(null, -1)
QDEL_NULL(gas_heat_object)
if (quality == GLOB.PREF_MED)
gas_heat_object.particles?.count = 250
gas_heat_object.particles?.spawning = 15
gas_heat_object = new /obj/particle_emitter/heat(null)
else if (quality == GLOB.PREF_HIGH)
gas_heat_object.particles?.count = 600
gas_heat_object.particles?.spawning = 35
gas_heat_object = new /obj/particle_emitter/heat/high(null)

vis_contents += gas_heat_object


/atom/movable/renderer/heat/Initialize()
. = ..()
Setup()
Expand Down
8 changes: 7 additions & 1 deletion code/_helpers/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var/global/list/language_keys[0] // Table of say codes for all languages
var/global/list/playable_species = list(SPECIES_HUMAN) // A list of ALL playable species, whitelisted, latejoin or otherwise.


GLOBAL_LIST_EMPTY(all_particles)

// Grabs
var/global/list/all_grabstates[0]
Expand Down Expand Up @@ -165,7 +166,12 @@ var/global/list/string_slot_flags = list(
var/datum/grab/G = all_grabstates[grabstate_name]
G.refresh_updown()

return 1
paths = typesof(/particles)
for (var/path in paths)
var/particles/P = new path()
GLOB.all_particles[P.name] = P

return TRUE

//*** params cache
var/global/list/paramslist_cache = list()
Expand Down
17 changes: 17 additions & 0 deletions code/_helpers/maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,20 @@
var/d = max - min
var/t = round((val - min) / d)
return val - (t * d)


/proc/MakeGenerator(g_type, g_min, g_max, g_rand = UNIFORM_RAND)
switch (g_rand)
if (1)
g_rand = NORMAL_RAND
if (2)
g_rand = LINEAR_RAND
if (3)
g_rand = SQUARE_RAND
else
g_rand = UNIFORM_RAND

if (!isnum(g_min) || !isnum(g_max))
return null

return generator(g_type, g_min, g_max, g_rand)
2 changes: 2 additions & 0 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@
virtual_mob = null
if (em_block)
QDEL_NULL(em_block)
if (particles)
particles = null
return ..()

/atom/movable/Bump(atom/A, yes)
Expand Down
18 changes: 1 addition & 17 deletions code/game/machinery/bluespace_drive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/obj/machinery/bluespacedrive/Initialize()
. = ..()
drive_sound = GLOB.sound_player.PlayLoopingSound(src, "\ref[src]", 'sound/machines/BSD_idle.ogg', 50, 7)
particles = new /particles/bluespace_torus
AddParticles(/particles/torus/bluespace)
set_light(1, 5, 15, 10, COLOR_CYAN)
update_icon()

Expand Down Expand Up @@ -165,22 +165,6 @@
floor.ChangeTurf(/turf/simulated/floor/bluespace)




/particles/bluespace_torus
width = 700
height = 700
count = 2700
spawning = 260
lifespan = 0.75 SECONDS
fade = 0.95 SECONDS
position = generator("circle", 16, 24, NORMAL_RAND)
velocity = generator("circle", -6, 6, NORMAL_RAND)
friction = 0.15
gradient = list(0, COLOR_WHITE, 0.75, COLOR_BLUE_LIGHT)
color_change = 0.125
drift = generator("vector", list(-0.2, -0.2), list(0.2, 0.2))

/datum/bubble_effect/bluespace_pulse
///List of mobs that can be swapped around when the pulse hits
var/list/mob/living/mobs_to_switch = list()
Expand Down
Loading

0 comments on commit 315943b

Please sign in to comment.