summaryrefslogtreecommitdiff
path: root/powder.c
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2010-09-25 18:11:25 (GMT)
committer Simon <simon@hardwired.org.uk>2010-09-25 18:11:25 (GMT)
commitc7dab50b51f51d8c386123b33d2a726740d03483 (patch)
treef598476a791b3cd4100fdbb0f10b594bae1e53cb /powder.c
parent3d6e7f8f62fc2e34c1d525842dc711c3be903a20 (diff)
downloadpowder-c7dab50b51f51d8c386123b33d2a726740d03483.zip
powder-c7dab50b51f51d8c386123b33d2a726740d03483.tar.gz
Add Anti-Matter
Diffstat (limited to 'powder.c')
-rw-r--r--powder.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/powder.c b/powder.c
index 42099fe..6c69084 100644
--- a/powder.c
+++ b/powder.c
@@ -1260,7 +1260,7 @@ void update_particles_i(pixel *vid, int start, int inc)
for(nx=-1; nx<2; nx++)
for(ny=-1; ny<2; ny++)
if(x+nx>=0 && y+ny>0 &&
- x+nx<XRES && y+ny<YRES && (nx || ny))
+ x+nx<XRES && y+ny<YRES && (nx || ny))
{
r = pmap[y+ny][x+nx];
if((r>>8)>=NPART || !r)
@@ -1290,6 +1290,35 @@ void update_particles_i(pixel *vid, int start, int inc)
}
}
}
+ else if(t==PT_AMTR)
+ {
+ for(nx=-1; nx<2; nx++)
+ for(ny=-1; ny<2; 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;
+ rt = parts[r>>8].type;
+ if((r&0xFF)!=PT_AMTR && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_NONE && (r&0xFF)!=PT_PHOT && (r&0xFF)!=PT_VOID && (r&0xFF)!=PT_BHOL)
+ {
+ t = parts[i].life++;
+ if(parts[i].life==3)
+ {
+ parts[i].type = PT_NONE;
+ kill_part(i);
+ }
+ parts[r>>8].life = 0;
+ parts[r>>8].type = PT_NONE;
+ kill_part(r>>8);
+ if(2>(rand()/(RAND_MAX/100)))
+ create_part(r>>8, x+nx, y+ny, PT_PHOT);
+ pv[y/CELL][x/CELL] -= 5.0f;
+ continue;
+ }
+ }
+ }
else if(t==PT_FIRW){
if(parts[i].tmp==0){
for(nx=-1; nx<2; nx++)