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> #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
{ {

View File

@ -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