diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-11-17 19:43:59 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-11-17 19:43:59 (GMT) |
| commit | e3594aba9e05c6865d396418c028049cda92c2f3 (patch) | |
| tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /src/elements/spng.c | |
| parent | fb43f7d23e99765ae093fc45608901cb5907d1d8 (diff) | |
| download | powder-e3594aba9e05c6865d396418c028049cda92c2f3.zip powder-e3594aba9e05c6865d396418c028049cda92c2f3.tar.gz | |
Remove old code
Diffstat (limited to 'src/elements/spng.c')
| -rw-r--r-- | src/elements/spng.c | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/src/elements/spng.c b/src/elements/spng.c deleted file mode 100644 index 9776c79..0000000 --- a/src/elements/spng.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include <element.h> - -int update_SPNG(UPDATE_FUNC_ARGS) { - int r, trade, rx, ry, tmp, np; - int limit = 50; - if (parts[i].life<limit && pv[y/CELL][x/CELL]<=3&&pv[y/CELL][x/CELL]>=-3&&parts[i].temp<=374.0f) - { - int absorbChanceDenom = parts[i].life*1000/limit + 500; - for (rx=-1; rx<2; rx++) - for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) - { - r = pmap[y+ry][x+rx]; - if (!r) - continue; - if (((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_FRZW) && parts[i].life<limit && 500>rand()%absorbChanceDenom) - { - parts[i].life++; - kill_part(r>>8); - } - if ((r&0xFF)==PT_SLTW && parts[i].life<limit && 50>rand()%absorbChanceDenom) - { - parts[i].life++; - if (rand()%4) - kill_part(r>>8); - else - part_change_type(r>>8, x+rx, y+ry, PT_SALT); - } - if ((r&0xFF)==PT_CBNW && parts[i].life<limit && 100>rand()%absorbChanceDenom) - { - parts[i].life++; - part_change_type(r>>8, x+rx, y+ry, PT_CO2); - } - if ((r&0xFF)==PT_PSTE && parts[i].life<limit && 20>rand()%absorbChanceDenom) - { - parts[i].life++; - create_part(r>>8, x+rx, y+ry, PT_CLST); - } - } - } - else - for (rx=-1; rx<2; rx++) - for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) - { - r = pmap[y+ry][x+rx]; - if ((!r)&&parts[i].life>=1)//if nothing then create water - { - np = create_part(-1,x+rx,y+ry,PT_WATR); - if (np>-1) parts[i].life--; - } - } - for ( trade = 0; trade<9; trade ++) - { - rx = rand()%5-2; - ry = rand()%5-2; - if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) - { - r = pmap[y+ry][x+rx]; - if (!r) - continue; - if ((r&0xFF)==PT_SPNG&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion - { - tmp = parts[i].life - parts[r>>8].life; - if (tmp ==1) - { - parts[r>>8].life ++; - parts[i].life --; - trade = 9; - } - else if (tmp>0) - { - parts[r>>8].life += tmp/2; - parts[i].life -= tmp/2; - trade = 9; - } - } - } - } - tmp = 0; - if (parts[i].life>0) - { - for (rx=-1; rx<2; rx++) - for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) - { - r = pmap[y+ry][x+rx]; - if (!r) - continue; - if ((r&0xFF)==PT_FIRE) - { - tmp++; - if (parts[r>>8].life>60) - parts[r>>8].life -= parts[r>>8].life/60; - else if (parts[r>>8].life>2) - parts[r>>8].life--; - } - } - } - if (tmp && parts[i].life>3) - parts[i].life -= parts[i].life/3; - if (tmp>1) - tmp = tmp/2; - if (tmp || parts[i].temp>=374) - for (rx=-1; rx<2; rx++) - for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) - { - r = pmap[y+ry][x+rx]; - if ((!r)&&parts[i].life>=1)//if nothing then create steam - { - np = create_part(-1,x+rx,y+ry,PT_WTRV); - if (np>-1) - { - parts[np].temp = parts[i].temp; - tmp--; - parts[i].life--; - parts[i].temp -= 20.0f; - } - } - } - if (tmp>0) - { - if (parts[i].life>tmp) - parts[i].life -= tmp; - else - parts[i].life = 0; - } - return 0; -} |
