diff options
| author | Simon 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) |
| commit | 91ec4d112567e54a7427e0c16ee14395d3d813f5 (patch) | |
| tree | c975442d0ea572d6e982ea15407901cb0a8ea96e /src/simulation/elements/SPNG.cpp | |
| parent | 86fc8e1eb31ed72ab02d7d1cee37fd5c9bbdfdb0 (diff) | |
| download | powder-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/SPNG.cpp')
| -rw-r--r-- | src/simulation/elements/SPNG.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/simulation/elements/SPNG.cpp b/src/simulation/elements/SPNG.cpp index f522bd6..dc4c711 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 |
