if(pv[y/CELL][x/CELL]>0.0 && 1>(rand()%1000));{
if (1>rand()%3)
create_part(i,x,y,PT_O2);
else
create_part(i,x,y,PT_NTRG);
}
if(pv[y/CELL][x/CELL]>0.0 && 1>(rand()%1000)){
#include <element.h>
int update_NTRO(UPDATE_FUNC_ARGS) {
int r, rx, ry;
for(rx=-1; rx<2; rx++)
for(ry=-1; ry<2; ry++)
if(x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES &&
pmap[y+ry][x+rx] &&
(pmap[y+ry][x+rx]&0xFF)!=PT_NTRO&&
(pmap[y+ry][x+rx]&0xFF)!=0xFF)
{
r = pmap[y+ry][x+rx];
if(pv[y/CELL][x/CELL]>0.0 && (1>rand()%1000))
{
if(1>rand()%3) create_part(i,x,y,PT_O2);
else
create_part(i,x,y,PT_NTRG);
}
if(pv[y/CELL][x/CELL]>10.0){
if ((r&0xFF)==PT_FIRE (r&0xFF)==PT_PLSM)
{
part_change_type(i,x,y,PT_FIRE);
}
}
if ((r&0xFF)==PT_HEXN (r&0xFF)==PT_HEXV)
{
part_change_type(i,x,y,PT_NITR);
kill_part(r>>8);
}
}
return 0;
}
#include <element.h>
int update_NTRO(UPDATE_FUNC_ARGS) {
int r, rx, ry;
if(pv[y/CELL][x/CELL]>1.0 && (1>rand()%500))
{
if(1>rand()%3) create_part(i,x,y,PT_O2);
else
create_part(i,x,y,PT_NTRG);
}
else
for(rx=-1; rx<2; rx++)
for(ry=-1; ry<2; ry++)
if(x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES &&
pmap[y+ry][x+rx] &&
(pmap[y+ry][x+rx]&0xFF)!=PT_NTRO&&
(pmap[y+ry][x+rx]&0xFF)!=0xFF)
{
r = pmap[y+ry][x+rx];
if(pv[y/CELL][x/CELL]>10.0){
if ((r&0xFF)==PT_FIRE (r&0xFF)==PT_PLSM)
{
part_change_type(i,x,y,PT_FIRE);
}
}
if ((r&0xFF)==PT_HEXN (r&0xFF)==PT_HEXV)
{
part_change_type(i,x,y,PT_NITR);
kill_part(r>>8);
}
}
return 0;
}