Fog/Rime can absorb gas to become acidic, condense to acid (#999)

This commit is contained in:
jm211
2025-03-15 00:12:25 -04:00
committed by GitHub
parent 917b299ecd
commit 56ede6caad
5 changed files with 27 additions and 4 deletions

View File

@@ -2493,6 +2493,19 @@ void Simulation::UpdateParticles(int start, int end)
else else
t = PT_LAVA; t = PT_LAVA;
} }
else if (t == PT_RIME)
{
if (parts[i].tmp > 5)
{
t = PT_ACID;
parts[i].life = 25 + 5 * parts[i].tmp;
parts[i].tmp = 0;
}
else
{
t = PT_WATR;
}
}
else else
s = 0; s = 0;
} }
@@ -2566,7 +2579,7 @@ void Simulation::UpdateParticles(int start, int end)
{ {
if (t==PT_ICEI || t==PT_LAVA || t==PT_SNOW) if (t==PT_ICEI || t==PT_LAVA || t==PT_SNOW)
parts[i].ctype = parts[i].type; parts[i].ctype = parts[i].type;
if (!(t==PT_ICEI && parts[i].ctype==PT_FRZW)) if (!(t==PT_ICEI && parts[i].ctype==PT_FRZW) && t!=PT_ACID)
parts[i].life = 0; parts[i].life = 0;
if (t == PT_FIRE) if (t == PT_FIRE)
{ {

View File

@@ -82,7 +82,7 @@ static int update(UPDATE_FUNC_ARGS)
sim->kill_part(ID(r)); sim->kill_part(ID(r));
} }
} }
else if (rt != PT_CLNE && rt != PT_PCLN && parts[i].life > 50 && sim->rng.chance(elements[rt].Hardness, 1000)) else if (rt != PT_CLNE && rt != PT_PCLN && ((rt != PT_FOG && rt != PT_RIME) || parts[ID(r)].tmp <= 5) && parts[i].life > 50 && sim->rng.chance(elements[rt].Hardness, 1000))
{ {
if (sim->parts_avg(i, ID(r),PT_GLAS)!= PT_GLAS)//GLAS protects stuff from acid if (sim->parts_avg(i, ID(r),PT_GLAS)!= PT_GLAS)//GLAS protects stuff from acid
{ {

View File

@@ -72,7 +72,7 @@ static int update(UPDATE_FUNC_ARGS)
} }
else if (TYP(r) != PT_ACID && TYP(r) != PT_CAUS && TYP(r) != PT_RFRG && TYP(r) != PT_RFGL) else if (TYP(r) != PT_ACID && TYP(r) != PT_CAUS && TYP(r) != PT_RFRG && TYP(r) != PT_RFGL)
{ {
if ((TYP(r) != PT_CLNE && TYP(r) != PT_PCLN && sim->rng.chance(elements[TYP(r)].Hardness, 1000)) && parts[i].life >= 50) if ((TYP(r) != PT_CLNE && TYP(r) != PT_PCLN && ((TYP(r) != PT_FOG && TYP(r) != PT_RIME) || parts[ID(r)].tmp <= 5) && sim->rng.chance(elements[TYP(r)].Hardness, 1000)) && parts[i].life > 50)
{ {
// GLAS protects stuff from acid // GLAS protects stuff from acid
if (sim->parts_avg(i, ID(r),PT_GLAS) != PT_GLAS) if (sim->parts_avg(i, ID(r),PT_GLAS) != PT_GLAS)

View File

@@ -67,6 +67,11 @@ static int update(UPDATE_FUNC_ARGS)
{ {
parts[i].life += sim->rng.between(0, 19); parts[i].life += sim->rng.between(0, 19);
} }
if (TYP(r) == PT_GAS && parts[i].tmp < 10)
{
sim->kill_part(ID(r));
parts[i].tmp++;
}
} }
} }
} }

View File

@@ -41,7 +41,7 @@ void Element::Element_RIME()
LowTemperature = ITL; LowTemperature = ITL;
LowTemperatureTransition = NT; LowTemperatureTransition = NT;
HighTemperature = 273.15f; HighTemperature = 273.15f;
HighTemperatureTransition = PT_WATR; HighTemperatureTransition = ST;
Update = &update; Update = &update;
} }
@@ -62,6 +62,11 @@ static int update(UPDATE_FUNC_ARGS)
sim->part_change_type(i,x,y,PT_FOG); sim->part_change_type(i,x,y,PT_FOG);
parts[i].life = sim->rng.between(60, 119); parts[i].life = sim->rng.between(60, 119);
} }
else if (TYP(r) == PT_GAS && parts[i].tmp < 10)
{
sim->kill_part(ID(r));
parts[i].tmp++;
}
else if (TYP(r)==PT_FOG&&parts[ID(r)].life>0) else if (TYP(r)==PT_FOG&&parts[ID(r)].life>0)
{ {
sim->part_change_type(i,x,y,PT_FOG); sim->part_change_type(i,x,y,PT_FOG);