summaryrefslogtreecommitdiff
path: root/powder.c
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2010-09-17 10:34:24 (GMT)
committer Simon <simon@hardwired.org.uk>2010-09-17 10:34:24 (GMT)
commitfa099338bb87d25ea660e74b16811d18256e7d51 (patch)
tree5893fbdb87a2a28dd205db05c70a8707dba112ca /powder.c
parent2ba8be7e492d0f3e964e51e7f0e5240ada0db6d8 (diff)
downloadpowder-fa099338bb87d25ea660e74b16811d18256e7d51.zip
powder-fa099338bb87d25ea660e74b16811d18256e7d51.tar.gz
Fix Coal and DESL
Diffstat (limited to 'powder.c')
-rw-r--r--powder.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/powder.c b/powder.c
index b5db6ff..ae7ba8f 100644
--- a/powder.c
+++ b/powder.c
@@ -237,6 +237,8 @@ inline int create_part(int p, int x, int y, int t)
parts[i].life = 150;
}
End Testing*/
+ if(t==PT_COAL)
+ parts[i].life = 110;
if(t==PT_FIRE)
parts[i].life = rand()%50+120;
if(t==PT_PLSM)
@@ -474,7 +476,7 @@ void update_particles_i(pixel *vid, int start, int inc)
if(sys_pause&&!framerender)
return;
- if(parts[i].life && t!=PT_ACID && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM)
+ if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM)
{
if(!(parts[i].life==10&&parts[i].type==PT_LCRY))
parts[i].life--;
@@ -656,7 +658,7 @@ void update_particles_i(pixel *vid, int start, int inc)
}
if(t==PT_GAS && pv[y/CELL][x/CELL]<-6.0f)
t = parts[i].type = PT_OIL;
- if(t==PT_DESL && pv[y/CELL][x/CELL]>12.0f) // Only way I know to make it
+ if(t==PT_DESL && pv[y/CELL][x/CELL]>5.0f) // Only way I know to make it
t = parts[i].type = PT_FIRE; // combust under pressure.
if(t==PT_GAS && pv[y/CELL][x/CELL]>6.0f)
t = parts[i].type = PT_OIL;
@@ -933,6 +935,34 @@ void update_particles_i(pixel *vid, int start, int inc)
}
}
}
+ else if(t==PT_COAL)
+ {
+ if(parts[i].life<=0){
+ t = PT_NONE;
+ kill_part(i);
+ create_part(-1, x, y, PT_FIRE);
+ goto killed;
+ } else if(parts[i].life < 100){
+ parts[i].life--;
+ create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_FIRE);
+ }
+
+ for(nx=-2; nx<3; nx++)
+ for(ny=-2; ny<3; ny++)
+ if(x+nx>=0 && y+ny>0 &&
+ x+nx<XRES && y+ny<YRES && (nx || ny))
+ {
+ r = pmap[y+ny][x+nx];
+ if((r>>8)>=NPART || !r)
+ continue;
+ if(((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM) && 1>(rand()%500))
+ {
+ if(parts[i].life>100){
+ parts[i].life = 99;
+ }
+ }
+ }
+ }
else if(t==PT_NTCT||t==PT_PTCT||t==PT_INWR)
{
for(nx=-2; nx<3; nx++)