diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-09-03 13:06:36 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-09-03 13:06:36 (GMT) |
| commit | ea68100724fdb5acbb77ff18032b05d35c9eeecc (patch) | |
| tree | 43e2814275246fa12add21855c81c77d4914cbcb /src | |
| parent | d6d40f88d141122d4779f592107eabf46bfb0af2 (diff) | |
| download | powder-ea68100724fdb5acbb77ff18032b05d35c9eeecc.zip powder-ea68100724fdb5acbb77ff18032b05d35c9eeecc.tar.gz | |
Added Powered Void
Diffstat (limited to 'src')
| -rw-r--r-- | src/graphics.c | 20 | ||||
| -rw-r--r-- | src/main.c | 6 | ||||
| -rw-r--r-- | src/powder.c | 17 |
3 files changed, 38 insertions, 5 deletions
diff --git a/src/graphics.c b/src/graphics.c index d8798c1..3056742 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1854,7 +1854,7 @@ void draw_parts(pixel *vid) draw_line(vid , nx, ny+3, player2[11], player2[12], 100, 100, 255, s); draw_line(vid , player2[11], player2[12], player2[15], player2[16], 100, 100, 255, s); } - if (cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP && t!=PT_GPMP && t!=PT_PBCN && t!=PT_FILT && t!=PT_HSWC && t!=PT_PCLN && t!=PT_DEUT && t!=PT_WIFI && t!=PT_LIFE)//nothing display but show needed color changes + if (cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP && t!=PT_GPMP && t!=PT_PBCN && t!=PT_FILT && t!=PT_HSWC && t!=PT_PCLN && t!=PT_DEUT && t!=PT_WIFI && t!=PT_LIFE && t!=PT_PVOD)//nothing display but show needed color changes { if (t==PT_PHOT) { @@ -1914,7 +1914,7 @@ void draw_parts(pixel *vid) t!=PT_LCRY && t!=PT_SWCH && t!=PT_PCLN && t!=PT_PUMP && t!=PT_HSWC && t!=PT_FILT && t!=PT_GPMP && t!=PT_PBCN && t!=PT_LIFE && - t!=PT_O2 && t!=PT_H2) + t!=PT_O2 && t!=PT_H2 && t!=PT_PVOD) { if (ptypes[parts[i].type].properties&TYPE_LIQUID) //special effects for liquids in fancy mode { @@ -3067,6 +3067,22 @@ void draw_parts(pixel *vid) blendpixel(vid, nx-1, ny+1, GR, 10, 10, 112); } } + else if (t==PT_PVOD) + { + uint8 GR = 0x3B+((parts[i].life>10?10:parts[i].life)*16); + vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(GR, 30, 30); + if (cmode == CM_BLOB) { + blendpixel(vid, nx+1, ny, GR, 30, 30, 223); + blendpixel(vid, nx-1, ny, GR, 30, 30, 223); + blendpixel(vid, nx, ny+1, GR, 30, 30, 223); + blendpixel(vid, nx, ny-1, GR, 30, 30, 223); + + blendpixel(vid, nx+1, ny-1, GR, 30, 30, 112); + blendpixel(vid, nx-1, ny-1, GR, 30, 30, 112); + blendpixel(vid, nx+1, ny+1, GR, 30, 30, 112); + blendpixel(vid, nx-1, ny+1, GR, 30, 30, 112); + } + } else if (t==PT_PUMP) { uint8 GR = 0x3B+((parts[i].life>10?10:parts[i].life)*19); @@ -151,9 +151,9 @@ static const char *it_msg = "The spacebar can be used to pause physics.\n" "'P' will take a screenshot and save it into the current directory.\n" "\n" - "\bgCopyright (c) 2008-11 Stanislaw K Skowronek (\brhttp://powder.unaligned.org\bg, \bbirc.unaligned.org #wtf\bg)\n" - "\bgCopyright (c) 2010-11 Simon Robertshaw, Skresanov Savely, cracker64, Bryan Hoyle, Nathan Cousins, jacksonmj,\n" - " Lieuwe Mosch\n" + "Contributors: \bgStanislaw K Skowronek (\brhttp://powder.unaligned.org\bg, \bbirc.unaligned.org #wtf\bg),\n" + "\bgSimon Robertshaw, Skresanov Savely, cracker64, Catelite, Bryan Hoyle, Nathan Cousins, jacksonmj,\n" + "\bgLieuwe Mosch, Anthony Boot\n" "\n" "\bgTo use online features such as saving, you need to register at: \brhttp://powdertoy.co.uk/Register.html" ; diff --git a/src/powder.c b/src/powder.c index e7afe4e..465158d 100644 --- a/src/powder.c +++ b/src/powder.c @@ -119,6 +119,8 @@ void init_can_move() can_move[t][PT_INVIS] = 3; //stop CNCT being displaced by other particles can_move[t][PT_CNCT] = 0; + //Powered void behaviour varies on powered state + can_move[t][PT_PVOD] = 3; } for (t=0;t<PT_NUM;t++) { @@ -291,6 +293,21 @@ int try_move(int i, int x, int y, int nx, int ny) parts[i].type=PT_NONE; return 0; } + if ((r&0xFF)==PT_PVOD) //this is where void eats particles + { + if(parts[r>>8].life == 10){ + if (parts[i].type == PT_STKM) + { + player[27] = 0; + } + if (parts[i].type == PT_STKM2) + { + player2[27] = 0; + } + parts[i].type=PT_NONE; + } + return 0; + } if ((r&0xFF)==PT_BHOL || (r&0xFF)==PT_NBHL) //this is where blackhole eats particles { if (parts[i].type == PT_STKM) |
