[MIRROR] Basic pollen-particles for plants pollenating. [MDB IGNORE] (#20592)

* 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

🆑
imageadd: Hydroponics trays now have pollen particles that they generate
when they share stats and chems. Non-allergenic!
/🆑

---------

Co-authored-by: san7890 <the@ san7890.com>

* Basic pollen-particles for plants pollenating.

---------

Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: san7890 <the@ san7890.com>
This commit is contained in:
SkyratBot
2023-04-17 17:53:30 +01:00
committed by GitHub
co-authored by san7890 ArcaneMusic
parent 20a50f5c35
commit 0d5e4e4ec9
10 changed files with 64 additions and 33 deletions
-14
View File
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -1,3 +1,4 @@
// Water related particles.
/particles/droplets
icon = 'icons/effects/particles/generic.dmi'
icon_state = list("dot"=2,"drop"=1)
-18
View File
@@ -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
+9
View File
@@ -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
Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

+2 -1
View File
@@ -1820,6 +1820,8 @@
#include "code\game\objects\effects\effect_system\fluid_spread\effects_smoke.dm"
#include "code\game\objects\effects\landmarks\atmospherics_sanity_landmarks.dm"
#include "code\game\objects\effects\particles\fire.dm"
#include "code\game\objects\effects\particles\misc.dm"
#include "code\game\objects\effects\particles\note_particles.dm"
#include "code\game\objects\effects\particles\smoke.dm"
#include "code\game\objects\effects\particles\water.dm"
#include "code\game\objects\effects\spawners\bombspawner.dm"
@@ -4719,7 +4721,6 @@
#include "code\modules\religion\burdened\burdened_trauma.dm"
#include "code\modules\religion\burdened\psyker.dm"
#include "code\modules\religion\festival\instrument_rites.dm"
#include "code\modules\religion\festival\note_particles.dm"
#include "code\modules\religion\honorbound\honorbound_rites.dm"
#include "code\modules\religion\honorbound\honorbound_trauma.dm"
#include "code\modules\religion\sparring\ceremonial_gear.dm"