From 91ec4d112567e54a7427e0c16ee14395d3d813f5 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 28 Aug 2012 12:38:18 +0100 Subject: [PATCH] GEL and SPNG absorb water from more elements and leave behind what the water was mixed width --- src/simulation/elements/GEL.cpp | 24 ++++++++++++++++++++++-- src/simulation/elements/SPNG.cpp | 23 ++++++++++++++++++++++- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/simulation/elements/GEL.cpp b/src/simulation/elements/GEL.cpp index 682976930..b42c4ba12 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)) { diff --git a/src/simulation/elements/SPNG.cpp b/src/simulation/elements/SPNG.cpp index f522bd6ed..dc4c71147 100644 --- a/src/simulation/elements/SPNG.cpp +++ b/src/simulation/elements/SPNG.cpp @@ -59,11 +59,32 @@ int Element_SPNG::update(UPDATE_FUNC_ARGS) r = pmap[y+ry][x+rx]; if (!r) continue; - if ((r&0xFF)==PT_WATR&&33>=rand()/(RAND_MAX/100)+1) + if (((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_FRZW)&&33>=rand()/(RAND_MAX/100)+1) { parts[i].life++; sim->kill_part(r>>8); } + if ((r&0xFF)==PT_SLTW&&33>=rand()/(RAND_MAX/100)+1) + { + parts[i].life++; + 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&&33>=rand()/(RAND_MAX/100)+1) + { + parts[i].life++; + 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_PSTE&&33>=rand()/(RAND_MAX/100)+1) + { + parts[i].life++; + sim->create_part(r>>8, x+rx, y+ry, PT_CLST); + } } } else