-
-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Particlening #3239
Merged
Merged
The Particlening #3239
Changes from 28 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
0ab1695
first off
rye-rice b231f33
this shit dont work
rye-rice aba18b3
Merge remote-tracking branch 'upstream/master' into particlening
rye-rice 438e76e
Merge remote-tracking branch 'upstream/master' into particlening
rye-rice c0d5245
Revert "this shit dont work"
rye-rice 08eea5f
Revert "Revert "this shit dont work""
rye-rice 1930851
The failed particle editor port, this is to revert and reviver when i…
rye-rice bd7cc65
Revert "The failed particle editor port, this is to revert and revive…
rye-rice 3221f27
works
rye-rice 0d6004a
progress
rye-rice d7f097c
feedback
rye-rice 0a7a5e6
blood changes
rye-rice e2f24ee
steam vents
rye-rice 1608d3a
revert after done
rye-rice 21b35f2
x
rye-rice 39594f5
Merge remote-tracking branch 'upstream/master' into particlening
rye-rice 6af47f0
Merge remote-tracking branch 'upstream/master' into particlening
rye-rice 9c7940f
Merge remote-tracking branch 'upstream/master' into particlening
rye-rice 474a66b
waga
rye-rice 089fdef
we balll
rye-rice a3ced96
Merge remote-tracking branch 'upstream/master' into particlening
rye-rice 26c2124
fixes
rye-rice 55c7d83
Merge remote-tracking branch 'upstream/master' into particlening
rye-rice 7be6dea
test
rye-rice f8580ba
Merge remote-tracking branch 'upstream/master' into particlening
rye-rice 8d8b82e
fix
rye-rice c4cd2fa
Merge remote-tracking branch 'upstream/master' into particlening
rye-rice f1b788d
cleanup
rye-rice 7e4c281
linters
rye-rice 2dbd844
Fuck
rye-rice e93ed81
Fuck(2)
rye-rice a919d82
Merge remote-tracking branch 'upstream/master' into particlening
rye-rice abf068a
Merge remote-tracking branch 'upstream/master' into particlening
rye-rice 8a6937d
fdakljhouliya908u7y6
rye-rice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//generator types | ||
#define GEN_NUM "num" | ||
#define GEN_VECTOR "vector" | ||
#define GEN_BOX "box" | ||
#define GEN_COLOR "color" | ||
#define GEN_CIRCLE "circle" | ||
#define GEN_SPHERE "sphere" | ||
#define GEN_SQUARE "square" | ||
#define GEN_CUBE "cube" | ||
|
||
///particle editor var modifiers | ||
#define P_DATA_GENERATOR "generator" | ||
#define P_DATA_ICON_ADD "icon_add" | ||
#define P_DATA_ICON_REMOVE "icon_remove" | ||
#define P_DATA_ICON_WEIGHT "icon_edit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// /obj/effect/abstract/particle_holder/var/particle_flags | ||
// Flags that effect how a particle holder displays something | ||
|
||
/// If we're inside something inside a mob, display off that mob too | ||
#define PARTICLE_ATTACH_MOB (1<<0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* returns the arguments given to a generator and manually extracts them from the internal byond object | ||
* returns: | ||
* * flat list of strings for args given to the generator. | ||
* * Note: this means things like "list(1,2,3)" will need to be processed | ||
*/ | ||
/proc/return_generator_args(generator/target) | ||
var/string_repr = "[target]" //the name of the generator is the string representation of it's _binobj, which also contains it's args | ||
string_repr = copytext(string_repr, 11, length(string_repr)) // strips extraneous data | ||
string_repr = replacetext(string_repr, "\"", "") // removes the " around the type | ||
return splittext(string_repr, ", ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,70 @@ | ||
/obj/effect/particle_emitter | ||
name = "" | ||
///objects can only have one particle on them at a time, so we use these abstract effects to hold and display the effects. You know, so multiple particle effects can exist at once. | ||
///also because some objects do not display particles due to how their visuals are built | ||
/obj/effect/abstract/particle_holder | ||
name = "particle holder" | ||
desc = "How are you reading this? Please make a bug report :)" | ||
appearance_flags = KEEP_APART|KEEP_TOGETHER|TILE_BOUND|PIXEL_SCALE|LONG_GLIDE //movable appearance_flags plus KEEP_APART and KEEP_TOGETHER | ||
vis_flags = VIS_INHERIT_PLANE | ||
layer = ABOVE_ALL_MOB_LAYER | ||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT | ||
anchored = TRUE | ||
mouse_opacity = 0 | ||
/// Holds info about how this particle emitter works | ||
/// See \code\__DEFINES\particles.dm | ||
var/particle_flags = NONE | ||
|
||
/obj/effect/particle_emitter/Initialize(mapload, time) | ||
var/atom/parent | ||
|
||
/obj/effect/abstract/particle_holder/Initialize(mapload, particle_path = /particles/smoke, particle_flags = NONE) | ||
. = ..() | ||
if(!loc) | ||
stack_trace("particle holder was created with no loc!") | ||
return INITIALIZE_HINT_QDEL | ||
// We nullspace ourselves because some objects use their contents (e.g. storage) and some items may drop everything in their contents on deconstruct. | ||
parent = loc | ||
loc = null | ||
|
||
// Mouse opacity can get set to opaque by some objects when placed into the object's contents (storage containers). | ||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT | ||
src.particle_flags = particle_flags | ||
particles = new particle_path() | ||
// /atom doesn't have vis_contents, /turf and /atom/movable do | ||
var/atom/movable/lie_about_areas = parent | ||
lie_about_areas.vis_contents += src | ||
RegisterSignal(parent, COMSIG_PARENT_QDELETING, PROC_REF(parent_deleted)) | ||
|
||
if(particle_flags & PARTICLE_ATTACH_MOB) | ||
RegisterSignal(parent, COMSIG_MOVABLE_MOVED, PROC_REF(on_move)) | ||
on_move(parent, null, NORTH) | ||
|
||
/obj/effect/abstract/particle_holder/Destroy(force) | ||
QDEL_NULL(particles) | ||
parent = null | ||
return ..() | ||
|
||
/// Non movables don't delete contents on destroy, so we gotta do this | ||
/obj/effect/abstract/particle_holder/proc/parent_deleted(datum/source) | ||
SIGNAL_HANDLER | ||
qdel(src) | ||
|
||
/// signal called when a parent that's been hooked into this moves | ||
/// does a variety of checks to ensure overrides work out properly | ||
/obj/effect/abstract/particle_holder/proc/on_move(atom/movable/attached, atom/oldloc, direction) | ||
SIGNAL_HANDLER | ||
|
||
if(!(particle_flags & PARTICLE_ATTACH_MOB)) | ||
return | ||
|
||
//remove old | ||
if(ismob(oldloc)) | ||
var/mob/particle_mob = oldloc | ||
particle_mob.vis_contents -= src | ||
|
||
// If we're sitting in a mob, we want to emit from it too, for vibes and shit | ||
if(ismob(attached.loc)) | ||
var/mob/particle_mob = attached.loc | ||
particle_mob.vis_contents += src | ||
|
||
/// Sets the particles position to the passed coordinate list (X, Y, Z) | ||
/// See [https://www.byond.com/docs/ref/#/{notes}/particles] for position documentation | ||
/obj/effect/abstract/particle_holder/proc/set_particle_position(list/pos) | ||
particles.position = pos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Acid related particles. | ||
/particles/acid | ||
icon = 'icons/effects/particles/goop.dmi' | ||
icon_state = list("goop_1" = 6, "goop_2" = 2, "goop_3" = 1) | ||
width = 100 | ||
height = 100 | ||
count = 100 | ||
spawning = 0.5 | ||
color = "#00ea2b80" //to get 96 alpha | ||
lifespan = 1.5 SECONDS | ||
fade = 1 SECONDS | ||
grow = -0.025 | ||
gravity = list(0, 0.15) | ||
position = generator(GEN_SPHERE, 0, 16, NORMAL_RAND) | ||
spin = generator(GEN_NUM, -15, 15, NORMAL_RAND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Fire related particles. | ||
/particles/bonfire | ||
icon = 'icons/effects/particles/bonfire.dmi' | ||
icon_state = "bonfire" | ||
width = 100 | ||
height = 100 | ||
count = 1000 | ||
spawning = 4 | ||
lifespan = 0.7 SECONDS | ||
fade = 1 SECONDS | ||
grow = -0.01 | ||
velocity = list(0, 0) | ||
position = generator(GEN_CIRCLE, 0, 16, NORMAL_RAND) | ||
drift = generator(GEN_VECTOR, list(0, -0.2), list(0, 0.2)) | ||
gravity = list(0, 0.95) | ||
scale = generator(GEN_VECTOR, list(0.3, 0.3), list(1,1), NORMAL_RAND) | ||
rotation = 30 | ||
spin = generator(GEN_NUM, -20, 20) | ||
|
||
/particles/embers | ||
icon = 'icons/effects/particles/generic.dmi' | ||
icon_state = list("dot" = 4,"cross" = 1,"curl" = 1) | ||
width = 64 | ||
height = 96 | ||
count = 500 | ||
spawning = 5 | ||
lifespan = 3 SECONDS | ||
fade = 1 SECONDS | ||
color = 0 | ||
color_change = 0.05 | ||
gradient = list("#FBAF4D", "#FCE6B6", "#FD481C") | ||
position = generator(GEN_BOX, list(-12,-16,0), list(12,16,0), NORMAL_RAND) | ||
drift = generator(GEN_VECTOR, list(-0.1,0), list(0.1,0.025)) | ||
spin = generator(GEN_NUM, list(-15,15), NORMAL_RAND) | ||
scale = generator(GEN_VECTOR, list(0.5,0.5), list(2,2), NORMAL_RAND) | ||
|
||
/particles/embers/lava | ||
width = 700 | ||
height = 700 | ||
gradient = list(LIGHT_COLOR_FLARE, LIGHT_COLOR_FLARE , COLOR_ALMOST_BLACK) | ||
spawning = 1 | ||
|
||
/particles/lava | ||
width = 700 | ||
height = 700 | ||
count = 500 | ||
spawning = 1 | ||
lifespan = 4 SECONDS | ||
fade = 2 SECONDS | ||
position = generator(GEN_CIRCLE, 16, 24, NORMAL_RAND) | ||
drift = generator(GEN_VECTOR, list(-0.2, -0.2), list(0.6, 0.6)) | ||
velocity = generator(GEN_CIRCLE, -6, 6, NORMAL_RAND) | ||
friction = 0.15 | ||
gradient = list(0,LIGHT_COLOR_FLARE , 0.75, COLOR_ALMOST_BLACK) | ||
color_change = 0.125 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.