mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-18 22:21:21 +02:00
Make GLAS strengthening reaction more controllable and not so arbitrary (#856)
This commit is contained in:
@@ -252,9 +252,9 @@ int Element_FIRE_update(UPDATE_FUNC_ARGS)
|
|||||||
if (rx > 1 || rx < -1) // Trend veins vertical
|
if (rx > 1 || rx < -1) // Trend veins vertical
|
||||||
parts[i].tmp = 1;
|
parts[i].tmp = 1;
|
||||||
}
|
}
|
||||||
else if (parts[i].ctype == PT_SALT && rt == PT_GLAS)
|
else if (parts[i].ctype == PT_SALT && rt == PT_GLAS && parts[ID(r)].life < 234 * 120)
|
||||||
{
|
{
|
||||||
parts[ID(r)].life = 10;
|
parts[ID(r)].life++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -52,28 +52,16 @@ static int update(UPDATE_FUNC_ARGS)
|
|||||||
auto press = int(sim->pv[y/CELL][x/CELL] * 64);
|
auto press = int(sim->pv[y/CELL][x/CELL] * 64);
|
||||||
auto diff = press - parts[i].tmp3;
|
auto diff = press - parts[i].tmp3;
|
||||||
|
|
||||||
// Determine whether the GLAS is chemically strengthened via life setting.
|
// Determine whether the GLAS is chemically strengthened via .life setting. (250 = Max., 16 = Min.)
|
||||||
if (parts[i].life > 0)
|
int strength = (parts[i].life / 120) + 16;
|
||||||
|
if (strength < 16)
|
||||||
|
strength = 16;
|
||||||
|
if (diff > strength || diff < -1 * strength)
|
||||||
{
|
{
|
||||||
// determined to be strengthened GLAS, increase the pressure by which it shatters
|
sim->part_change_type(i, x, y, PT_BGLA);
|
||||||
// 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;
|
parts[i].tmp3 = press;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create(ELEMENT_CREATE_FUNC_ARGS)
|
static void create(ELEMENT_CREATE_FUNC_ARGS)
|
||||||
|
Reference in New Issue
Block a user