summaryrefslogtreecommitdiff
path: root/src/elements/exot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/elements/exot.c')
-rw-r--r--src/elements/exot.c65
1 files changed, 55 insertions, 10 deletions
diff --git a/src/elements/exot.c b/src/elements/exot.c
index 234ab9e..81f7c7d 100644
--- a/src/elements/exot.c
+++ b/src/elements/exot.c
@@ -16,20 +16,67 @@
#include <element.h>
int update_EXOT(UPDATE_FUNC_ARGS) {
-
-
+ int r, rt, rx, ry, nb, rrx, rry;
+ for (rx=-2; rx<=2; rx++)
+ for (ry=-2; ry<=2; ry++)
+ if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES) {
+ r = pmap[y+ry][x+rx];
+ if (!r)
+ continue;
+ if ((r&0xFF)==PT_WARP)
+ {
+ if (parts[r>>8].tmp2>2000)
+ if (1>rand()%100)
+ {
+ parts[i].tmp2 += 50;
+ }
+ }
+ }
parts[i].tmp--;
- if (parts[i].tmp<1) {
+ parts[i].tmp2--;
+ if (parts[i].tmp<1 || parts[i].tmp>250)
parts[i].tmp = 250;
+ if (parts[i].tmp2<1)
+ parts[i].tmp2 = 1;
+ else if (parts[i].tmp2>2500)
+ {
+ parts[i].tmp2 = 2500;
+ part_change_type(i, x, y, PT_WARP);
+ parts[i].temp = 10000;
}
-
+ else
+ pv[y/CELL][x/CELL] += (parts[i].tmp2/2000) * CFDS;
+ if (pv[y/CELL][x/CELL]>200 && parts[i].temp>9000 && parts[i].tmp2>200)
+ {
+ part_change_type(i, x, y, PT_WARP);
+ parts[i].tmp2 = 2500;
+ }
return 0;
}
int graphics_EXOT(GRAPHICS_FUNC_ARGS)
{
- *colr = cpart->tmp / 2 + 0x08;
- *colg = cpart->tmp * 2 + 0x28;
- *colb = cpart->tmp / 2 + 0x08;
+ int q = cpart->temp;
+ int b = cpart->tmp;
+ if ((cpart->tmp2 - 1)>rand()%1000)
+ {
+ float frequency = 0.90045;
+ *colr = (sin(frequency*q + 0) * 127 + 255);
+ *colg = (sin(frequency*q + 2) * 127 + 255);
+ *colb = (sin(frequency*q + 4) * 127 + 255);
+ *firea = 100;
+ *firer = 0;
+ *fireg = 0;
+ *fireb = 0;
+ *pixel_mode |= PMODE_FLAT;
+// *pixel_mode |= FIRE_ADD;
+ *pixel_mode |= PMODE_FLARE;
+ }
+ else
+ {
+ float frequency = 0.00045;
+ *colr = (sin(frequency*q + 0) * 127 + (b/1.7));
+ *colg = (sin(frequency*q + 2) * 127 + (b/1.7));
+ *colb = (sin(frequency*q + 4) * 127 + (b/1.7));
*cola = cpart->tmp / 6;
*firea = *cola;
*firer = *colr;
@@ -37,8 +84,6 @@ int graphics_EXOT(GRAPHICS_FUNC_ARGS)
*fireb = *colb;
*pixel_mode |= FIRE_ADD;
*pixel_mode |= PMODE_BLUR;
-
-
-
+ }
return 0;
}