VIRS only burns with PLSM, and has the NO_DECO graphics flag

This commit is contained in:
jacob1 2013-09-28 19:45:15 -04:00
parent 13d89ce9e1
commit 8fc39d659c
4 changed files with 29 additions and 13 deletions

View File

@ -132,12 +132,13 @@ int Element_FIRE::update(UPDATE_FUNC_ARGS)
}
if ((surround_space || sim->elements[rt].Explosive) &&
(t!=PT_SPRK || (rt!=PT_RBDM && rt!=PT_LRBD && rt!=PT_INSL)) &&
(t!=PT_PHOT || rt!=PT_INSL) &&
(rt!=PT_SPNG || parts[r>>8].life==0) &&
sim->elements[rt].Flammable && (sim->elements[rt].Flammable + (int)(sim->pv[(y+ry)/CELL][(x+rx)/CELL]*10.0f))>(rand()%1000))
sim->elements[rt].Flammable && (sim->elements[rt].Flammable + (int)(sim->pv[(y+ry)/CELL][(x+rx)/CELL] * 10.0f)) > (rand()%1000) &&
//exceptions, t is the thing causing the spark and rt is what's burning
(t != PT_SPRK || (rt != PT_RBDM && rt != PT_LRBD && rt != PT_INSL)) &&
(t != PT_PHOT || rt != PT_INSL) &&
(rt != PT_SPNG || parts[r>>8].life == 0))
{
sim->part_change_type(r>>8,x+rx,y+ry,PT_FIRE);
sim->part_change_type(r>>8, x+rx, y+ry, PT_FIRE);
parts[r>>8].temp = restrict_flt(sim->elements[PT_FIRE].Temperature + (sim->elements[rt].Flammable/2), MIN_TEMP, MAX_TEMP);
parts[r>>8].life = rand()%80+180;
parts[r>>8].tmp = parts[r>>8].ctype = 0;
@ -145,7 +146,8 @@ int Element_FIRE::update(UPDATE_FUNC_ARGS)
sim->pv[y/CELL][x/CELL] += 0.25f * CFDS;
}
}
if (sim->legacy_enable) updateLegacy(UPDATE_FUNC_SUBCALL_ARGS);
if (sim->legacy_enable)
updateLegacy(UPDATE_FUNC_SUBCALL_ARGS);
return 0;
}
@ -218,7 +220,6 @@ int Element_FIRE::updateLegacy(UPDATE_FUNC_ARGS) {
//#TPT-Directive ElementHeader Element_FIRE static int graphics(GRAPHICS_FUNC_ARGS)
int Element_FIRE::graphics(GRAPHICS_FUNC_ARGS)
{
int caddress = restrict_flt(restrict_flt((float)cpart->life, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
*colr = (unsigned char)ren->flm_data[caddress];

View File

@ -19,7 +19,7 @@ Element_VIRS::Element_VIRS()
HotAir = 0.000f * CFDS;
Falldown = 2;
Flammable = 100;
Flammable = 0;
Explosive = 0;
Meltable = 0;
Hardness = 20;
@ -43,7 +43,7 @@ Element_VIRS::Element_VIRS()
HighTemperatureTransition = PT_VRSG;
Update = &Element_VIRS::update;
Graphics = &Element_VIRS::graphics;
}
//#TPT-Directive ElementHeader Element_VIRS static int update(UPDATE_FUNC_ARGS)
@ -104,13 +104,21 @@ int Element_VIRS::update(UPDATE_FUNC_ARGS)
return 0;
}
//soap cures virus
else if ((r&0xFF) == PT_SOAP || (r&0xFF) == PT_FIRE)
else if ((r&0xFF) == PT_SOAP)
{
parts[i].pavg[0] += 10;
if (!((rndstore&0x7)>>1))
sim->kill_part(r>>8);
return 0;
}
else if ((r&0xFF) == PT_PLSM)
{
if (surround_space && 10 + (int)(sim->pv[(y+ry)/CELL][(x+rx)/CELL]) > (rand()%100))
{
sim->create_part(i, x, y, PT_PLSM);
return 1;
}
}
//transforms things into virus here
else if ((r&0xFF) != PT_VIRS && (r&0xFF) != PT_VRSS && (r&0xFF) != PT_VRSG && (r&0xFF) != PT_DMND)
{
@ -142,4 +150,11 @@ int Element_VIRS::update(UPDATE_FUNC_ARGS)
return 0;
}
//#TPT-Directive ElementHeader Element_VIRS static int graphics(GRAPHICS_FUNC_ARGS)
int Element_VIRS::graphics(GRAPHICS_FUNC_ARGS)
{
*pixel_mode |= NO_DECO;
return 1;
}
Element_VIRS::~Element_VIRS() {}

View File

@ -43,7 +43,7 @@ Element_VRSG::Element_VRSG()
HighTemperatureTransition = NT;
Update = &Element_VIRS::update;
Graphics = &Element_VIRS::graphics;
}
Element_VRSG::~Element_VRSG() {}

View File

@ -19,7 +19,7 @@ Element_VRSS::Element_VRSS()
HotAir = 0.000f * CFDS;
Falldown = 0;
Flammable = 5;
Flammable = 0;
Explosive = 0;
Meltable = 0;
Hardness = 1;
@ -43,7 +43,7 @@ Element_VRSS::Element_VRSS()
HighTemperatureTransition = PT_VIRS;
Update = &Element_VIRS::update;
Graphics = &Element_VIRS::graphics;
}
Element_VRSS::~Element_VRSS() {}