From 0d5e4e4ec9ecbb2196bbc9263691555a102631ea Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 17 Apr 2023 18:53:30 +0200 Subject: [PATCH] [MIRROR] Basic pollen-particles for plants pollenating. [MDB IGNORE] (#20592) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Basic pollen-particles for plants pollenating. (#74675) Legally endorsed nightcode 👍 ## About The Pull Request When 2 plants are adjacent to each other, they will begin to cross-pollenate, sharing their potency, instability, and yield values between the two. This has been in the game since #50001 , however we never added a more clear visual tell that cross-pollenation exists. Thanks to the magic of *barticles*, now you can! ![image](https://user-images.githubusercontent.com/41715314/231359363-07c7f354-d2f6-4d5e-8b59-5f968781135f.png) _pictured: wheat and tomatoes pollenating_ Adds a simple particle effect, largely lifted from bonfires, that indicates that two plants are sharing stats at minimum. ## Why It's Good For The Game Following discussion from #74621, it was decided we needed and preferred a more visual cue to the mechanic. As a general point I think that's a longer term fix to the issue, and this adds more visual clarity to an otherwise arcane mechanic (heh). Looking for feedback on how to improve the look of the particles but for fast nightcode I think I did okay for a first try ## Changelog :cl: imageadd: Hydroponics trays now have pollen particles that they generate when they share stats and chems. Non-allergenic! /:cl: --------- Co-authored-by: san7890 * Basic pollen-particles for plants pollenating. --------- Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Co-authored-by: san7890 --- code/datums/components/echolocation.dm | 14 -------- code/game/objects/effects/particles/fire.dm | 19 +++++++++++ code/game/objects/effects/particles/misc.dm | 32 ++++++++++++++++++ .../effects/particles}/note_particles.dm | 0 code/game/objects/effects/particles/smoke.dm | 1 + code/game/objects/effects/particles/water.dm | 1 + code/game/objects/structures/bonfire.dm | 18 ---------- code/modules/hydroponics/hydroponics.dm | 9 +++++ icons/effects/particles/pollen.dmi | Bin 0 -> 346 bytes tgstation.dme | 3 +- 10 files changed, 64 insertions(+), 33 deletions(-) create mode 100644 code/game/objects/effects/particles/misc.dm rename code/{modules/religion/festival => game/objects/effects/particles}/note_particles.dm (100%) create mode 100644 icons/effects/particles/pollen.dmi diff --git a/code/datums/components/echolocation.dm b/code/datums/components/echolocation.dm index 12547587ff8..9d32744359d 100644 --- a/code/datums/components/echolocation.dm +++ b/code/datums/components/echolocation.dm @@ -180,17 +180,3 @@ /atom/movable/screen/fullscreen/echo/Destroy() QDEL_NULL(particles) return ..() - -/particles/echo - icon = 'icons/effects/particles/echo.dmi' - icon_state = list("echo1" = 1, "echo2" = 1, "echo3" = 2) - width = 480 - height = 480 - count = 1000 - spawning = 0.5 - lifespan = 2 SECONDS - fade = 1 SECONDS - gravity = list(0, -0.1) - position = generator(GEN_BOX, list(-240, -240), list(240, 240), NORMAL_RAND) - drift = generator(GEN_VECTOR, list(-0.1, 0), list(0.1, 0)) - rotation = generator(GEN_NUM, 0, 360, NORMAL_RAND) diff --git a/code/game/objects/effects/particles/fire.dm b/code/game/objects/effects/particles/fire.dm index 462f8ef2713..703fd6b06b5 100644 --- a/code/game/objects/effects/particles/fire.dm +++ b/code/game/objects/effects/particles/fire.dm @@ -1,3 +1,4 @@ +// Fire related particles. /particles/embers icon = 'icons/effects/particles/generic.dmi' icon_state = list("dot"=4,"cross"=1,"curl"=1) @@ -14,3 +15,21 @@ drift = generator(GEN_VECTOR, list(-0.1,0), list(0.1,0.025), UNIFORM_RAND) spin = generator(GEN_NUM, list(-15,15), NORMAL_RAND) scale = generator(GEN_VECTOR, list(0.5,0.5), list(2,2), NORMAL_RAND) + +/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) diff --git a/code/game/objects/effects/particles/misc.dm b/code/game/objects/effects/particles/misc.dm new file mode 100644 index 00000000000..8fba3c7e1c4 --- /dev/null +++ b/code/game/objects/effects/particles/misc.dm @@ -0,0 +1,32 @@ +//general or un-matched particles, make a new file if a few can be sorted together. +/particles/pollen + icon = 'icons/effects/particles/pollen.dmi' + icon_state = "pollen" + 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/echo + icon = 'icons/effects/particles/echo.dmi' + icon_state = list("echo1" = 1, "echo2" = 1, "echo3" = 2) + width = 480 + height = 480 + count = 1000 + spawning = 0.5 + lifespan = 2 SECONDS + fade = 1 SECONDS + gravity = list(0, -0.1) + position = generator(GEN_BOX, list(-240, -240), list(240, 240), NORMAL_RAND) + drift = generator(GEN_VECTOR, list(-0.1, 0), list(0.1, 0)) + rotation = generator(GEN_NUM, 0, 360, NORMAL_RAND) diff --git a/code/modules/religion/festival/note_particles.dm b/code/game/objects/effects/particles/note_particles.dm similarity index 100% rename from code/modules/religion/festival/note_particles.dm rename to code/game/objects/effects/particles/note_particles.dm diff --git a/code/game/objects/effects/particles/smoke.dm b/code/game/objects/effects/particles/smoke.dm index d4b6f21cd48..13c8da4218e 100644 --- a/code/game/objects/effects/particles/smoke.dm +++ b/code/game/objects/effects/particles/smoke.dm @@ -1,3 +1,4 @@ +// All the smoke variant particles. /particles/smoke icon = 'icons/effects/particles/smoke.dmi' icon_state = list("smoke_1" = 1, "smoke_2" = 1, "smoke_3" = 2) diff --git a/code/game/objects/effects/particles/water.dm b/code/game/objects/effects/particles/water.dm index e2a036d23cb..88e0ef542e3 100644 --- a/code/game/objects/effects/particles/water.dm +++ b/code/game/objects/effects/particles/water.dm @@ -1,3 +1,4 @@ +// Water related particles. /particles/droplets icon = 'icons/effects/particles/generic.dmi' icon_state = list("dot"=2,"drop"=1) diff --git a/code/game/objects/structures/bonfire.dm b/code/game/objects/structures/bonfire.dm index 287db0e4b4d..1c0b36f863d 100644 --- a/code/game/objects/structures/bonfire.dm +++ b/code/game/objects/structures/bonfire.dm @@ -183,22 +183,4 @@ if(..()) buckled_mob.pixel_y -= 13 -/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) - #undef BONFIRE_FIRE_STACK_STRENGTH diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 18d5f1463dc..d024225e287 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -776,6 +776,7 @@ * * Range - The Oview range of trays to which to look for plants to donate reagents. */ /obj/machinery/hydroponics/proc/pollinate(range = 1) + var/any_adjacent = FALSE for(var/obj/machinery/hydroponics/T in oview(src, range)) //Here is where we check for window blocking. if(!Adjacent(T) && range <= 1) @@ -784,6 +785,9 @@ T.myseed.set_potency(round((T.myseed.potency+(1/10)*(myseed.potency-T.myseed.potency)))) T.myseed.set_instability(round((T.myseed.instability+(1/10)*(myseed.instability-T.myseed.instability)))) T.myseed.set_yield(round((T.myseed.yield+(1/2)*(myseed.yield-T.myseed.yield)))) + any_adjacent = TRUE + if(isnull(particles)) + particles = new /particles/pollen() if(myseed.instability >= 20 && prob(70) && length(T.myseed.reagents_add)) var/list/datum/plant_gene/reagent/possible_reagents = list() for(var/datum/plant_gene/reagent/reag in T.myseed.genes) @@ -794,6 +798,8 @@ myseed.genes += reagent_gene.Copy() myseed.reagents_from_genes() continue + if(!any_adjacent) + particles = null /** * Pest Mutation Proc. @@ -993,6 +999,8 @@ name = initial(name) desc = initial(desc) set_weedlevel(0) //Has a side effect of cleaning up those nasty weeds + if(particles) + particles = null return else if(istype(O, /obj/item/storage/part_replacer)) RefreshParts() @@ -1110,6 +1118,7 @@ name = initial(name) desc = initial(desc) TRAY_NAME_UPDATE + particles = null if(self_sustaining) //No reason to pay for an empty tray. set_self_sustaining(FALSE) else diff --git a/icons/effects/particles/pollen.dmi b/icons/effects/particles/pollen.dmi new file mode 100644 index 0000000000000000000000000000000000000000..559c4d1846f68871390b7a0243abdd020947f766 GIT binary patch literal 346 zcmeAS@N?(olHy`uVBq!ia0vp^4nVBH!3HE3&8=$zQh8M&5hX6E#mPmP1tppJc?=8{ zbArPPib}tK2`>2f^@*0ZuGYCT=Yuzd8eBAf@JQ#pkLF2+qMqIz7REuwmyNv?<~*8o zWKxJiuxDqtvFhd(5+_WaJo3@@I^)~A;UO2-r{bcZ&jp%56TcQSM)NQPXDA!TXMQsU z+PvJ;#WAE}&f6J#c^ec&*yP(x-`qKEyj_XKz(!{(le45+(8fOk57!7c>}j9TqceVd$;@Z9V^?{ln0@{mdc_VhaKp zq8i*7GZ>}fKb6