diff --git a/src/simulation/elements/FIRE.cpp b/src/simulation/elements/FIRE.cpp index b813857fc..b467d5da1 100644 --- a/src/simulation/elements/FIRE.cpp +++ b/src/simulation/elements/FIRE.cpp @@ -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]; diff --git a/src/simulation/elements/VIRS.cpp b/src/simulation/elements/VIRS.cpp index 7880a924b..b30eecf20 100644 --- a/src/simulation/elements/VIRS.cpp +++ b/src/simulation/elements/VIRS.cpp @@ -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() {} diff --git a/src/simulation/elements/VRSG.cpp b/src/simulation/elements/VRSG.cpp index 8c699d775..e787bfeae 100644 --- a/src/simulation/elements/VRSG.cpp +++ b/src/simulation/elements/VRSG.cpp @@ -43,7 +43,7 @@ Element_VRSG::Element_VRSG() HighTemperatureTransition = NT; Update = &Element_VIRS::update; - + Graphics = &Element_VIRS::graphics; } Element_VRSG::~Element_VRSG() {} diff --git a/src/simulation/elements/VRSS.cpp b/src/simulation/elements/VRSS.cpp index 903a5f725..808fc93d5 100644 --- a/src/simulation/elements/VRSS.cpp +++ b/src/simulation/elements/VRSS.cpp @@ -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() {}