Added some heat to TNT and IGNC
This commit is contained in:
parent
fcac7dbe09
commit
a716c59610
@ -1,7 +1,7 @@
|
|||||||
#include <element.h>
|
#include <element.h>
|
||||||
|
|
||||||
int update_BANG(UPDATE_FUNC_ARGS) {
|
int update_BANG(UPDATE_FUNC_ARGS) {
|
||||||
int r, rx, ry;
|
int r, rx, ry, nb;
|
||||||
if(parts[i].tmp==0)
|
if(parts[i].tmp==0)
|
||||||
{
|
{
|
||||||
for (rx=-1; rx<2; rx++)
|
for (rx=-1; rx<2; rx++)
|
||||||
@ -33,33 +33,32 @@ int update_BANG(UPDATE_FUNC_ARGS) {
|
|||||||
}
|
}
|
||||||
else if(parts[i].tmp>=3)
|
else if(parts[i].tmp>=3)
|
||||||
{
|
{
|
||||||
|
float otemp = parts[i].temp-275.13f;
|
||||||
//Explode!!
|
//Explode!!
|
||||||
pv[y/CELL][x/CELL] += 0.5f;
|
pv[y/CELL][x/CELL] += 0.5f;
|
||||||
if(!(rand()%3))
|
if(!(rand()%3))
|
||||||
{
|
{
|
||||||
if(!(rand()%2))
|
if(!(rand()%2))
|
||||||
{
|
{
|
||||||
parts[i].tmp = 0;
|
|
||||||
create_part(i, x, y, PT_FIRE);
|
create_part(i, x, y, PT_FIRE);
|
||||||
|
parts[i].temp = (MAX_TEMP/4)+otemp;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
parts[i].tmp = 0;
|
|
||||||
create_part(i, x, y, PT_SMKE);
|
create_part(i, x, y, PT_SMKE);
|
||||||
|
parts[i].temp = (MAX_TEMP/4)+otemp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!(rand()%15))
|
if(!(rand()%15))
|
||||||
{
|
{
|
||||||
int nb = create_part(i, x, y, PT_BOMB);
|
create_part(i, x, y, PT_BOMB);
|
||||||
if (nb!=-1) {
|
parts[i].tmp = 1;
|
||||||
parts[nb].tmp = 1;
|
parts[i].life = 50;
|
||||||
parts[nb].life = 50;
|
parts[i].temp = (MAX_TEMP/3)+otemp;
|
||||||
//parts[nb].temp = MAX_TEMP;
|
parts[i].vx = rand()%20-10;
|
||||||
parts[nb].vx = rand()%20-10;
|
parts[i].vy = rand()%20-10;
|
||||||
parts[nb].vy = rand()%20-10;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -31,6 +31,7 @@ int update_IGNT(UPDATE_FUNC_ARGS) {
|
|||||||
parts[nb].life = 30;
|
parts[nb].life = 30;
|
||||||
parts[nb].vx = rand()%20-10;
|
parts[nb].vx = rand()%20-10;
|
||||||
parts[nb].vy = rand()%20-10;
|
parts[nb].vy = rand()%20-10;
|
||||||
|
parts[nb].temp = 400.0f+parts[i].temp-273.15;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -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);
|
colb = colb>255 ? 255 : (colb<0 ? 0 : colb);
|
||||||
parts[i].dcolour = 0xFF000000 | (colr<<16) | (colg<<8) | colb;
|
parts[i].dcolour = 0xFF000000 | (colr<<16) | (colg<<8) | colb;
|
||||||
}
|
}
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user