Added some heat to TNT and IGNC

This commit is contained in:
Simon Robertshaw 2011-12-21 17:39:53 +00:00
parent fcac7dbe09
commit a716c59610
3 changed files with 12 additions and 12 deletions

View File

@ -1,7 +1,7 @@
#include <element.h>
int update_BANG(UPDATE_FUNC_ARGS) {
int r, rx, ry;
int r, rx, ry, nb;
if(parts[i].tmp==0)
{
for (rx=-1; rx<2; rx++)
@ -33,33 +33,32 @@ int update_BANG(UPDATE_FUNC_ARGS) {
}
else if(parts[i].tmp>=3)
{
float otemp = parts[i].temp-275.13f;
//Explode!!
pv[y/CELL][x/CELL] += 0.5f;
if(!(rand()%3))
{
if(!(rand()%2))
{
parts[i].tmp = 0;
create_part(i, x, y, PT_FIRE);
parts[i].temp = (MAX_TEMP/4)+otemp;
}
else
{
parts[i].tmp = 0;
create_part(i, x, y, PT_SMKE);
parts[i].temp = (MAX_TEMP/4)+otemp;
}
}
else
{
if(!(rand()%15))
{
int nb = create_part(i, x, y, PT_BOMB);
if (nb!=-1) {
parts[nb].tmp = 1;
parts[nb].life = 50;
//parts[nb].temp = MAX_TEMP;
parts[nb].vx = rand()%20-10;
parts[nb].vy = rand()%20-10;
}
create_part(i, x, y, PT_BOMB);
parts[i].tmp = 1;
parts[i].life = 50;
parts[i].temp = (MAX_TEMP/3)+otemp;
parts[i].vx = rand()%20-10;
parts[i].vy = rand()%20-10;
}
else
{

View File

@ -31,6 +31,7 @@ int update_IGNT(UPDATE_FUNC_ARGS) {
parts[nb].life = 30;
parts[nb].vx = rand()%20-10;
parts[nb].vy = rand()%20-10;
parts[nb].temp = 400.0f+parts[i].temp-273.15;
}
}
else

View File

@ -1092,7 +1092,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
colb = colb>255 ? 255 : (colb<0 ? 0 : colb);
parts[i].dcolour = 0xFF000000 | (colr<<16) | (colg<<8) | colb;
}
return i;
}