Added chemically strengthening GLAS (#837)

This commit is contained in:
Departing 2022-04-04 23:17:08 -04:00 committed by GitHub
parent 254b4a642a
commit d5f94f4718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View File

@ -251,6 +251,10 @@ int Element_FIRE_update(UPDATE_FUNC_ARGS)
if (rx > 1 || rx < -1) // Trend veins vertical
parts[i].tmp = 1;
}
else if (parts[i].ctype == PT_SALT && rt == PT_GLAS)
{
parts[ID(r)].life = 10;
}
}
if ((surround_space || sim->elements[rt].Explosive) &&

View File

@ -51,12 +51,29 @@ static int update(UPDATE_FUNC_ARGS)
{
auto press = int(sim->pv[y/CELL][x/CELL] * 64);
auto diff = press - parts[i].tmp3;
if (diff > 16 || diff < -16)
// Determine whether the GLAS is chemically strengthened via life setting.
if (parts[i].life > 0)
{
sim->part_change_type(i,x,y,PT_BGLA);
// determined to be strengthened GLAS, increase the pressure by which it shatters
// set to 160 because that's a value where the effect is noticable. the 3x increase didn't do much
if (diff > 160 || diff < -160)
{
sim->part_change_type(i, x, y, PT_BGLA);
}
}
else
{
// regular ol' GLAS
if (diff > 16 || diff < -16)
{
sim->part_change_type(i, x, y, PT_BGLA);
}
}
parts[i].tmp3 = press;
return 0;
}
static void create(ELEMENT_CREATE_FUNC_ARGS)