summaryrefslogtreecommitdiff
path: root/src/simulation/elements/GEL.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-28 11:38:18 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-28 11:38:18 (GMT)
commit91ec4d112567e54a7427e0c16ee14395d3d813f5 (patch)
treec975442d0ea572d6e982ea15407901cb0a8ea96e /src/simulation/elements/GEL.cpp
parent86fc8e1eb31ed72ab02d7d1cee37fd5c9bbdfdb0 (diff)
downloadpowder-91ec4d112567e54a7427e0c16ee14395d3d813f5.zip
powder-91ec4d112567e54a7427e0c16ee14395d3d813f5.tar.gz
GEL and SPNG absorb water from more elements and leave behind what the water was mixed width
Diffstat (limited to 'src/simulation/elements/GEL.cpp')
-rw-r--r--src/simulation/elements/GEL.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/simulation/elements/GEL.cpp b/src/simulation/elements/GEL.cpp
index 6829769..b42c4ba 100644
--- a/src/simulation/elements/GEL.cpp
+++ b/src/simulation/elements/GEL.cpp
@@ -61,12 +61,32 @@ int Element_GEL::update(UPDATE_FUNC_ARGS)
continue;
//Desaturation
- if (((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || (r&0xFF)==PT_CBNW)
- && parts[i].tmp<100)
+ if (((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_FRZW) && parts[i].tmp<100)
{
parts[i].tmp++;
sim->kill_part(r>>8);
}
+ if (((r&0xFF)==PT_PSTE) && parts[i].tmp<100)
+ {
+ parts[i].tmp++;
+ sim->create_part(r>>8, x+rx, y+ry, PT_CLST);
+ }
+ if (((r&0xFF)==PT_SLTW) && parts[i].tmp<100)
+ {
+ parts[i].tmp++;
+ if (rand()%4)
+ sim->kill_part(r>>8);
+ else
+ sim->part_change_type(r>>8, x+rx, y+ry, PT_SALT);
+ }
+ if (((r&0xFF)==PT_CBNW) && parts[i].tmp<100)
+ {
+ parts[i].tmp++;
+ if (rand()%4)
+ sim->kill_part(r>>8);
+ else
+ sim->part_change_type(r>>8, x+rx, y+ry, PT_CO2);
+ }
if ((r&0xFF)==PT_SPNG && parts[i].tmp<100 && ((parts[r>>8].life+1)>parts[i].tmp))
{