summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-10-13 14:32:23 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-10-13 16:33:22 (GMT)
commitaf21bcd353ae76a15364dfec3bd1c4c568845d39 (patch)
tree69b8a613db33cb532d8b9946e90b7e70baffc850 /src/graphics.c
parent9dc154f1f1667bb7fc73aca6bd5d6fad7c381a0e (diff)
downloadpowder-af21bcd353ae76a15364dfec3bd1c4c568845d39.zip
powder-af21bcd353ae76a15364dfec3bd1c4c568845d39.tar.gz
Some changes to LIGH/EMP/TESC based on changes in MaksProg's mod v0.3
Weaker and shorter EMP flash. TESC has correct tmp value when created with replace mode. LIGH harms STKM. Gravity affects LIGH in create_part if p==-2, instead of in update_LIGH, so that TESC lightning is not affected by gravity.
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c63
1 files changed, 46 insertions, 17 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 83c9a5a..1f10b11 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1728,22 +1728,24 @@ void xor_rect(pixel *vid, int x, int y, int w, int h)
void draw_other(pixel *vid) // EMP effect
{
- int i, j;
- if (emp_decor>0 && !sys_pause) emp_decor-=emp_decor/50+1;
- if (emp_decor>100) emp_decor=100;
+ int i, j;
+ if (emp_decor>0 && !sys_pause) emp_decor-=emp_decor/25+2;
+ if (emp_decor>40) emp_decor=40;
if (cmode==CM_NOTHING) // no in nothing mode
- return;
- if (emp_decor)
- for (j=0; j<YRES; j++)
- for (i=0; i<XRES; i++)
- {
- int r=emp_decor*2.5, g=100+emp_decor*1.5, b=255;
- float a=1.0*emp_decor/110;
- if (r>255) r=255;
- if (g>255) g=255;
- if (b>255) g=255;
- drawpixel(vid, i, j, r, g, b, a*255);
- }
+ return;
+ if (emp_decor)
+ {
+ int r=emp_decor*2.5, g=100+emp_decor*1.5, b=255;
+ int a=(1.0*emp_decor/110)*255;
+ if (r>255) r=255;
+ if (g>255) g=255;
+ if (b>255) g=255;
+ for (j=0; j<YRES; j++)
+ for (i=0; i<XRES; i++)
+ {
+ drawpixel(vid, i, j, r, g, b, a);
+ }
+ }
}
//the main function for drawing the particles
@@ -3356,8 +3358,16 @@ void draw_parts(pixel *vid)
uint8 R = 235;
uint8 G = 245;
uint8 B = 255;
- float a=0.8*parts[i].life/40;
- if (a>0.8) a=0.8;
+ float a;
+ if (parts[i].tmp2!=3)
+ {
+ a=0.8*parts[i].life/40;
+ if (a>0.8) a=0.8;
+ }
+ else
+ {
+ a=1.0;
+ }
blendpixel(vid, nx, ny, R, G, B, 255);
if (cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY)
{
@@ -3398,6 +3408,25 @@ void draw_parts(pixel *vid)
}
}
}
+ else if (cmode!=CM_NOTHING)
+ {
+ blendpixel(vid, x, y, R, G, B, 255);
+
+ blendpixel(vid, x, y-1, R, G, B, 150);
+ blendpixel(vid, x-1, y, R, G, B, 150);
+ blendpixel(vid, x+1, y, R, G, B, 150);
+ blendpixel(vid, x, y+1, R, G, B, 150);
+
+ blendpixel(vid, x-1, y-1, R, G, B, 100);
+ blendpixel(vid, x+1, y-1, R, G, B, 100);
+ blendpixel(vid, x+1, y+1, R, G, B, 100);
+ blendpixel(vid, x-1, y+1, R, G, B, 100);
+
+ blendpixel(vid, x, y-2, R, G, B, 50);
+ blendpixel(vid, x-2, y, R, G, B, 50);
+ blendpixel(vid, x+2, y, R, G, B, 50);
+ blendpixel(vid, x, y+2, R, G, B, 50);
+ }
}
else if (t==PT_DEST)
{