The Dust Motes Update: What if you could see ZAS? (#36891)

* The Dust Motes Update

* fartflow

* finer dust
This commit is contained in:
DeityLink
2024-08-10 11:21:28 +02:00
committed by GitHub
parent 0421663329
commit f3bc347b8b
6 changed files with 114 additions and 0 deletions

View File

@@ -1975,6 +1975,7 @@ var/list/weekend_days = list("Friday", "Saturday", "Sunday")
#define PS_NARSIEHASRISEN1 "Nar-SieHasRisen1"
#define PS_NARSIEHASRISEN2 "Nar-SieHasRisen2"
#define PS_NARSIEHASRISEN3 "Nar-SieHasRisen3"
#define PS_ZAS_DUST "ZAS Dust"
//Particles variable defines
#define PVAR_SPAWNING "spawning"
@@ -1987,3 +1988,7 @@ var/list/weekend_days = list("Friday", "Saturday", "Sunday")
#define PVAR_LAYER "layer"
#define PVAR_PIXEL_X "pixel_x"
#define PVAR_PIXEL_Y "pixel_y"
#define PVAR_LIFESPAN "lifespan"
#define PVAR_FADE "fade"
#define ZAS_DUST_TURFS_PER_TICK 20

View File

@@ -90,6 +90,7 @@ Class Procs:
if(!close_turfs.len)
continue
AM.airflow_dest = pick(close_turfs) //Pick a random midpoint to fly towards.
AM.GotoAirflowDest(differential/10)
@@ -133,6 +134,8 @@ Class Procs:
if(abs(differential) >= zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure))
flow(A.movables(), differential)
flow(B.movables(), -differential)
A.blow_dust_motes(src, differential)
B.blow_dust_motes(src, -differential)
if(equiv)
if(direct)
@@ -193,6 +196,7 @@ Class Procs:
var/differential = A.air.return_pressure() - air.return_pressure()
if(abs(differential) >= zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure))
flow(A.movables(), abs(differential), differential < 0)
A.blow_dust_motes(src, differential)
if(equiv)
A.air.copy_from(air)

View File

@@ -259,6 +259,39 @@ Class Procs:
for(var/atom/A in burnable_atoms)
A.checkburn()
/zone/proc/blow_dust_motes(var/connection_edge/edge, var/differential)
if (!edge)
return
var/dust_differential = log(abs(differential) * 3)
var/list/my_turfs = contents.Copy()
var/i = ZAS_DUST_TURFS_PER_TICK
while (my_turfs.len > 0 && i > 0)
var/turf/T = pick(my_turfs)
my_turfs.Remove(T)
i--
var/turf/closest_turf = null
var/closest_dist = 999
for(var/turf/U in edge.connecting_turfs)
var/dist = get_dist(T,U)
if(dist > 0 && dist < closest_dist)
closest_dist = dist
closest_turf = U
if (closest_turf)
if (differential > 0)
T.flying_dust(closest_turf,dust_differential,min(99,abs(differential*2)))
else
T.flying_dust(closest_turf,-dust_differential,min(99,abs(differential*2)))
/zone/proc/blow_dust_motes_but_with_turf(var/turf/target_turf, var/differential)
if (!target_turf)
return
var/dust_differential = log(abs(differential) * 3)
for (var/turf/T in contents)
if (differential > 0)
T.flying_dust(target_turf,dust_differential,min(99,abs(differential*2)))
else
T.flying_dust(target_turf,-dust_differential,min(99,abs(differential*2)))
#ifdef ZAS_COLOR
#undef ZAS_COLOR
#endif

View File

@@ -116,6 +116,10 @@
holder.particles.color = new_value
if (PVAR_SCALE)
holder.particles.scale = new_value
if (PVAR_LIFESPAN)
holder.particles.lifespan = new_value
if (PVAR_FADE)
holder.particles.fade = new_value
if (PVAR_PLANE)
holder.plane = new_value
if (PVAR_LAYER)
@@ -161,6 +165,7 @@ var/list/particle_string_to_type = list(
PS_NARSIEHASRISEN1 = /particles/narsie_has_risen,
PS_NARSIEHASRISEN2 = /particles/narsie_has_risen/next,
PS_NARSIEHASRISEN3 = /particles/narsie_has_risen/last,
PS_ZAS_DUST = /particles/zas_dust,
)
/particles
@@ -373,3 +378,62 @@ var/list/particle_string_to_type = list(
icon_state = "risen"
plane = ABOVE_HUD_PLANE
//ZAS DUST
/particles/zas_dust
width = 96
height = 96
count = 20
spawning = 2
color = "#FFFFFF99"
lifespan = 1 SECONDS
fade = 0.5 SECONDS
icon = 'icons/effects/effects_particles.dmi'
icon_state = "zas_dust"
position = generator("box", list(-15,-15), list(15,15))
velocity = list(0,0)
/turf
var/last_dust_time = 0
var/last_dust_strength = 0
/turf/proc/flying_dust(var/turf/dest, var/wind_strength = 3, var/wind_opacity = 128)
if (last_dust_time == SSair.times_fired && last_dust_strength > wind_strength)
return
last_dust_time = SSair.times_fired
last_dust_strength = wind_strength
var/this_dust_time = last_dust_time
add_particles(PS_ZAS_DUST)
adjust_particles(PVAR_SPAWNING, 2, PS_ZAS_DUST)
adjust_particles(PVAR_VELOCITY, dir2dust(dest,wind_strength), PS_ZAS_DUST)
adjust_particles(PVAR_LIFESPAN, 3 SECONDS / abs(wind_strength), PS_ZAS_DUST)
adjust_particles(PVAR_FADE, 1.5 SECONDS / abs(wind_strength), PS_ZAS_DUST)
adjust_particles(PVAR_COLOR, "#FFFFFF[num2hex(wind_opacity)]", PS_ZAS_DUST)
spawn(SSair.wait*2)
if (last_dust_time == this_dust_time)
adjust_particles(PVAR_SPAWNING, 0, PS_ZAS_DUST)
/turf/proc/dir2dust(var/turf/dest, var/wind_strength = 3)
if(!dest)
return list(0,0)
switch(get_dir(src, dest))
if (NORTH)
return list(0,wind_strength)
if (SOUTH)
return list(0,-wind_strength)
if (EAST)
return list(wind_strength,0)
if (WEST)
return list(-wind_strength,0)
if (NORTHEAST)
return list(wind_strength,wind_strength)
if (SOUTHEAST)
return list(wind_strength,-wind_strength)
if (NORTHWEST)
return list(-wind_strength,wind_strength)
if (SOUTHWEST)
return list(-wind_strength,-wind_strength)
else
return list(0,0)

View File

@@ -188,6 +188,10 @@
to_chat(user, "<span class = 'warning'>You gas yourself!</span>")
H.reagents.add_reagent(SPACE_DRUGS, rand(10,50))
else
if(istype(location,/turf/simulated))
var/turf/simulated/S = location
if(S.zone)
S.zone.blow_dust_motes_but_with_turf(location, -700)
// Was /turf/, now /mob/
for(var/mob/living/M in view(location,aoe_range))
if (M.internal != null && M.wear_mask && (M.wear_mask.clothing_flags & MASKINTERNALS))
@@ -215,6 +219,10 @@
if(is_unconscious)
H.visible_message("<span class='warning'><b>[H]</b>Explodes in a shower of gore! Damn, what a madman!", "<span class='warning'>The super-fart made you explode!</span>")
playsound(location, 'sound/effects/superfart.ogg', 50, 0)
if(istype(location,/turf/simulated))
var/turf/simulated/S = location
if(S.zone)
S.zone.blow_dust_motes_but_with_turf(location, -700)
for(var/mob/living/V in oviewers(aoe_range, get_turf(H)))
if(!airborne_can_reach(location,get_turf(V),aoe_range))
continue

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB